Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Unit test modified so it is build pipeline friendly and does not break the tenants of good Unit Testing

The Unit Test

        [Test]
        public void load_all_of_file_using_delegate_with_stubbed_data()
        {
            // arrange
            string fileToLoad = "c:/tmp/KeyboardHandler.java.txt";
            FileLoader cut = new FileLoader();
            int expectedBytesRead = 55;

            // act
            int bytesRead = cut.LoadFile(fileToLoad, (fname) =>
            {
                List<string> result = new();

                result.Add("using NUnit.Framework;");
                result.Add("using System.Collections.Generic;");

                return result;
            });

            // assert
            Assert.AreEqual(expectedBytesRead, bytesRead);
        }

  • No labels

0 Comments

You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account.