public CarrierControllerTests() { mediator = A.Fake <IMediator>(); this.auditService = A.Fake <IAuditService>(); A.CallTo(() => mediator.SendAsync(A <GetCountries> ._)).Returns(new List <CountryData> { new CountryData { Id = new Guid("4345FB05-F7DF-4E16-939C-C09FCA5C7D7B"), Name = "United Kingdom" }, new CountryData { Id = new Guid("29B0D09E-BA77-49FB-AF95-4171408C07C9"), Name = "Germany" } }); A.CallTo( () => mediator.SendAsync(A <GetCarrierForNotification> .That.Matches(p => p.CarrierId == carrierId))) .Returns(CreateCarrier(carrierId)); carrierController = new CarrierController(mediator, new AddAddressBookEntryMap(), this.auditService); A.CallTo(() => auditService.AddAuditEntry(this.mediator, notificationId, "user", NotificationAuditType.Added, NotificationAuditScreenType.IntendedCarrier)); }
public List <CarrierBase> GetCarriers(double lengthUnit, double cooPoint) { List <CarrierBase> carrierBases = new List <CarrierBase>(); List <DataModel.Carrier> carriers = new CarrierController().GetCarrier(); foreach (DataModel.Carrier c in carriers) { CarrierBase uc; Brush brush = new SolidColorBrush((Color)ColorConverter.ConvertFromString(c.Color)); if (c.Type == 0) { uc = new View.Control.Carrier( brush, c.Width * lengthUnit, c.Heigh * lengthUnit); } else if (c.Type == 1) { uc = new Shelf( brush, c.Width * lengthUnit, c.Heigh * lengthUnit); } else //(c.Type==2) { uc = new Heater( brush, c.Width * lengthUnit, c.Heigh * lengthUnit); } uc.Margin = new Thickness((c.Grid - 9) * lengthUnit * cooPoint, c.Position * lengthUnit, 0, 0); uc.CarrierName = c.CarrierName; carrierBases.Add(uc); } return(carrierBases); }
public CarrierControllerTests() { mediator = A.Fake<IMediator>(); A.CallTo(() => mediator.SendAsync(A<GetCountries>._)).Returns(new List<CountryData> { new CountryData { Id = new Guid("4345FB05-F7DF-4E16-939C-C09FCA5C7D7B"), Name = "United Kingdom" }, new CountryData { Id = new Guid("29B0D09E-BA77-49FB-AF95-4171408C07C9"), Name = "Germany" } }); A.CallTo( () => mediator.SendAsync(A<GetCarrierForNotification>.That.Matches(p => p.CarrierId == carrierId))) .Returns(CreateCarrier(carrierId)); carrierController = new CarrierController(mediator, new AddAddressBookEntryMap()); }
public static void SetUpClass() { controller = GetClient().Carrier; }