Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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

The Unit Test

Code Block
languagec#
        [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);
        }

...