public void SetUp() { _decoder = Substitute.For <ITrackDecoding>(); //Rigtige Klasser _uut = new Logger(); _Event = new SeparationEvent(); _Track1 = new TrackData() { Tag = "TAG1", X = 1000, Y = 2000, Altitude = 3000, Course = 30, Velocity = 23, FormattedTimestamp = "14-05-2018 17:18 53 1111" }; _Track2 = new TrackData() { Tag = "TAG2", X = 1000, Y = 2000, Altitude = 3000, Course = 30, Velocity = 23, FormattedTimestamp = "14-05-2018 17:18 53 1111" }; _Update = new Update(_decoder); //Lister _Tracklist = new List <ITracks>() { _Track1, _Track2 }; _fakeTransponderData = new TrackDataEventArgs(_Tracklist); //Substitueret _CalcDistance = Substitute.For <ICalcDistance>(); _calcCourse = Substitute.For <ICalcCourse>(); _calcVelocity = Substitute.For <ICalcVelocity>(); _monitor = Substitute.For <IMonitors>(); _decoder.TrackDataReadyForCalculation += (o, args) => _Tracklist = args.TrackData; }
//Skal initialisere Calc udefra plus tilføje alt til listen! public void TrackCalculated(IMonitors monitor, ICalcDistance distance, ICalcCourse course, ICalcVelocity vel, ILog logger, ISeparation separation, List <ITracks> list) { //Initialisering af klasserne Monitor = monitor; Distance = distance; Velocity = vel; Course = course; Logger = logger; Separation = separation; }
public void CalcCourse_Receives_Correct_Tracks() { _calcCourse = Substitute.For <ICalcCourse>(); Action(); RaiseFakeEvent(); RaiseFakeEvent(); _uut.UpdatesTrack(_Tracklist); _calcCourse.Received().Calculate(_Track1, _Track2); }
//public Print(IOutput output) //{ // _myOutput = output; //} public Print(IUpdate update, ICalcDistance calcDist, ICalcCourse calcCourse, ICalcVelocity calcVel, ILog logger, ISeparation separation, IMonitors monitor, IOutput output, List <ITracks> tracks) { _Update = update; CalcDist = calcDist; CalcVel = calcVel; CalcCourse = calcCourse; Logger = logger; Separation = separation; _myOutput = output; Printing(tracks, monitor); }
public void Setup() { _calcdist = Substitute.For <ICalcDistance>(); _calccourse = Substitute.For <ICalcCourse>(); _calcvelocity = Substitute.For <ICalcVelocity>(); _update = Substitute.For <IUpdate>(); _output = Substitute.For <IOutput>(); _tracks = new List <ITracks>(); _track = Substitute.For <TrackData>(); _monitor = Substitute.For <IMonitors>(); _uut = new Print(_update, _calcdist, _calccourse, _calcvelocity, _logger, _separation, _monitor, _output, _tracks); }
public void CalcCourse_Receives_Call_If_Monitor_Is_True_Through_Update() { _calcCourse = Substitute.For <ICalcCourse>(); _Track1.X = 20000; _Track2.X = 10000; _Track1.Y = 20000; _Track2.Y = 20000; Action(); RaiseFakeEvent(); //Tracks osv. Check RaiseFakeEvent(); //Check om den får kaldet _calcCourse.Received().Calculate(_Track1, _Track2); }
public void SetUp() { _decoder = Substitute.For <ITrackDecoding>(); //Rigtige Klasser _Track1 = new TrackData() { Tag = "TAG1", X = 10000, Y = 21000, Altitude = 3000, Course = 0, Velocity = 100, FormattedTimestamp = "14-05-2018 17:18 53 4000" }; _Track2 = new TrackData() { Tag = "TAG1", X = 50000, Y = 20000, Altitude = 3000, Course = 0, Velocity = 100, FormattedTimestamp = "14-05-2018 17:18 53 1111" }; _Track3 = new TrackData() { Tag = "TAG1", X = 100, Y = 21000, Altitude = 3000, Course = 0, Velocity = 100, FormattedTimestamp = "14-05-2018 17:18 53 4000" }; _CalcDistance = new CalcDistance(); _calcCourse = new CalcCourse(); _calcVelocity = new CalcVelocity(); _monitor = new Monitor(); _uut = new Update(_decoder); //Lister _Tracklist = new List <ITracks>() { _Track1, _Track2 }; _fakeTransponderData = new TrackDataEventArgs(_Tracklist); //Substitueret _logger = Substitute.For <ILog>(); _output = Substitute.For <IOutput>(); _print = Substitute.For <IPrints>(); _Separation = Substitute.For <ISeparation>(); _decoder.TrackDataReadyForCalculation += (o, args) => _Tracklist = args.TrackData; }
public void Setup() { _uut = new CalcCourse(); _Track1 = new TrackData() { Tag = "TAG1", X = 10000, Y = 21000, Altitude = 3000, Course = 0, Velocity = 100, FormattedTimestamp = "14-05-2018 17:18 53 4000" }; _Track2 = new TrackData() { Tag = "TAG1", X = 50000, Y = 20000, Altitude = 3000, Course = 0, Velocity = 100, FormattedTimestamp = "14-05-2018 17:18 53 1111" }; _Track3 = new TrackData() { Tag = "TAG1", X = 100, Y = 21000, Altitude = 3000, Course = 0, Velocity = 100, FormattedTimestamp = "14-05-2018 17:18 53 4000" }; _Tracklist = new List <ITracks>() { _Track1, _Track2, _Track3 }; _Update = Substitute.For <IUpdate>(); }
public void Setup() { _track1 = Substitute.For <ITracks>(); _track2 = Substitute.For <ITracks>(); _decoder = Substitute.For <ITrackDecoding>(); receivedTrackData = new List <ITracks>(); _uut = new Update(_decoder); _calcDistance = Substitute.For <ICalcDistance>(); _calcCourse = Substitute.For <ICalcCourse>(); _calcVelocity = Substitute.For <ICalcVelocity>(); _logger = Substitute.For <ILog>(); _separation = Substitute.For <ISeparation>(); _monitor = Substitute.For <IMonitors>(); //Tilsæt ny data _track1.Tag = "Tag1"; _track1.Altitude = 500; _track1.X = 20000; _track1.Y = 40000; //_track1.Course = 0; _track1.Timestamp = new DateTime(20180419152929150); //_track1.Velocity = 0; _track2.Tag = "Tag1"; _track2.Altitude = 600; _track2.X = 40000; _track2.Y = 90000; //_track2.Course = 0; _track2.Timestamp = new DateTime(20180419152929100); //_track2.Velocity = 0; _fakeTransponderData = new TrackDataEventArgs(new List <ITracks>()); _fakeTransponderData.TrackData.Add(Substitute.For <ITracks>()); _fakeTransponderData.TrackData.Add(Substitute.For <ITracks>()); //Her bliver eventet sat til at være lige med receivedTrackData _decoder.TrackDataReadyForCalculation += (o, args) => receivedTrackData = args.TrackData; }
public void CalcCourse_Set() { _calcCourse = new CalcCourse(); Assert.AreEqual(_calcCourse, _calcCourse); }