コード例 #1
0
        public void CreatesNewTypingIntervalWhenFileChanges()
        {
            var sut = new FileInteractionTransformer(_context);

            sut.ProcessEvent(TestTypingEvent(0, 1, "File1.cs"));
            sut.ProcessEvent(TestTypingEvent(1, 2, "File2.cs"));

            var expected = new[] { ExpectedInterval(0, 1, "File1.cs", true), ExpectedInterval(1, 2, "File2.cs", true) };

            Assert.AreEqual(expected, sut.SignalEndOfEventStream());
        }
コード例 #2
0
        public void ResultingIntervalsDontOverlap2()
        {
            var sut = new FileInteractionTransformer(_context);

            sut.ProcessEvent(TestReadingEvent(0, 2, "File1.cs"));
            sut.ProcessEvent(TestTypingEvent(1, 3, "File2.cs"));

            var expected = new[] { ExpectedInterval(0, 2, "File1.cs", false), ExpectedInterval(2, 3, "File2.cs", true) };

            Assert.AreEqual(expected, sut.SignalEndOfEventStream());
        }
コード例 #3
0
        public void IgnoresEditEventsWhileDebugging()
        {
            var sut = new FileInteractionTransformer(_context);

            sut.ProcessEvent(TestDebuggerEvent(0, 1, "File1.cs", true));
            sut.ProcessEvent(TestTypingEvent(1, 2, "File1.cs"));
            sut.ProcessEvent(TestDebuggerEvent(2, 3, "File1.cs", false));
            sut.ProcessEvent(TestTypingEvent(3, 4, "File1.cs"));

            var expected = new[] { ExpectedInterval(0, 3, "File1.cs", false), ExpectedInterval(3, 4, "File1.cs", true) };

            Assert.AreEqual(expected, sut.SignalEndOfEventStream());
        }
コード例 #4
0
        public void CreatesNewIntervalWhenBothCriteriaChange()
        {
            var sut = new FileInteractionTransformer(_context);

            sut.ProcessEvent(TestReadingEvent(0, 1, "File1.cs"));
            sut.ProcessEvent(TestTypingEvent(1, 2, "File2.cs"));

            var expected = new[] { ExpectedInterval(0, 1, "File1.cs", false), ExpectedInterval(1, 2, "File2.cs", true) };

            var actual = sut.SignalEndOfEventStream();

            Assert.AreEqual(expected, actual);
        }