public void Setup() { _tagsManager = Substitute.For <ITagsManager>(); _courseCalculator = Substitute.For <ICourseCalculator>(); _velocityCalculator = Substitute.For <IVelocityCalculator>(); _tracksManager = Substitute.For <ITracksManager>(); _seperationEventChecker = Substitute.For <ISeperationEventChecker>(); _uut = new TrackWarehouse(_tagsManager, _courseCalculator, _velocityCalculator, _tracksManager, _seperationEventChecker); _tracks = new List <Track> { new Track() { Tag = "1" }, new Track() { Tag = "2" }, new Track() { Tag = "1" } }; _tags = new List <string> { "1", "2" }; // Det gør ingen forskel, hvad der står i x.Manage() _tagsManager.WhenForAnyArgs(x => x.Manage(ref _tags, _tracks)) .Do(x => x[0] = _tags); }
public void SetUp() { _transponderReceiver = Substitute.For <ITransponderReceiver>(); _trackTransmitter = new TrackTransmitter(); _dateTimeBuilder = new DateTimeBuilder(); _trackObjectifier = new TrackObjectifier(_dateTimeBuilder); _trackReciever = new TrackReciever(_transponderReceiver, _trackObjectifier, _trackTransmitter); _output = Substitute.For <IOutput>(); _tracksManager = Substitute.For <ITracksManager>(); _tagsManager = Substitute.For <ITagsManager>(); _courseCalculator = Substitute.For <ICourseCalculator>(); _velocityCalculator = Substitute.For <IVelocityCalculator>(); _seperationEventChecker = Substitute.For <ISeperationEventChecker>(); _uut = new TrackWarehouse(_tagsManager, _courseCalculator, _velocityCalculator, _tracksManager, _seperationEventChecker); _atmController = new AtmController(_trackTransmitter, _output, _uut); _list = new List <string> { "ATR423;39045;12932;14000;20151006213456000" }; _trackTransmitter.TrackReady += (o, args) => { _recievedTracks = args.TrackList; }; // Arrange _tags = new List <string> { "ATR423" }; _tagsManager.WhenForAnyArgs(x => x.Manage(ref _tags, new List <Track>())) .Do(x => x[0] = _tags); // Act _transponderReceiver.TransponderDataReady += Raise.EventWith(new RawTransponderDataEventArgs(_list)); }