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()); }
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()); }
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()); }
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); }