public void Update_Conflicting_LogtoFile() { Track t1 = new Track(); t1.Tag = "ABC"; t1.Timestamp = new DateTime(2017, 04, 23, 12, 18, 30, 123); Track t2 = new Track(); t2.Tag = "DEF"; t1.Timestamp = new DateTime(2017, 04, 23, 12, 18, 30, 123); List <Track> liste = new List <Track>(); liste.Add(t1); liste.Add(t2); compare.ConflictingTracks = liste; _uut.Update(); var fileText = File.ReadAllLines("logfile.txt"); var fil = fileText[0]; Assert.That(fil, Is.EqualTo( "ALARM!!!! Conflicting flights: ABC, DEF Time stamp: 2017/4/23, at 12:18:30 and 123 milliseconds")); }
public void SetUp() { log = Substitute.For <ILogging>(); compare = new FakeCompare(); writer = Substitute.For <IWriter>(); _uut = new Detection(compare, log, writer); Track t1 = new Track(); t1.Tag = "ABC"; t1.Timestamp = DateTime.Now; Track t2 = new Track(); t2.Tag = "DEF"; compare.ConflictingTracks.Add(t1); compare.ConflictingTracks.Add(t2); _uut.Update(); }