Esempio n. 1
0
        public void WhenCreatingRelativeByteReference_ByteBeneathZero_ReturnCorrectFile()
        {
            // Setup test objects
            LogViewModel testLogViewModel = new LogViewModel();

            List <Tuple <string, long> > testLogFileLocations = new List <Tuple <string, long> >
            {
                new Tuple <string, long>("log1", 100),
                new Tuple <string, long>("log2", 220),
                new Tuple <string, long>("log3", 440),
                new Tuple <string, long>("log4", 660),
                new Tuple <string, long>("log5", 880)
            };

            testLogViewModel.CreateLogFiles(testLogFileLocations);

            long   byteWithinFile = -455;
            string logFileName    = "log3";

            // Perform test
            long relativeByteReference = testLogViewModel.CreateRelativeByteReference(byteWithinFile, logFileName);

            // Check test result
            long expectedByteReference = 320;

            Assert.AreEqual(expectedByteReference, relativeByteReference);
        }