public void SetsNotificationProperties() { notification.NotificationNumber = "GB 001 00250"; notification.HasSpecialHandlingRequirements = true; notification.PhysicalCharacteristics = new[] { PhysicalCharacteristicsInfo.CreatePhysicalCharacteristicsInfo(PhysicalCharacteristicType.Sludgy) }; movement.NotificationId = notification.Id; movementDetails = null; var result = GenerateViewModel(); new ExpectedMovementViewModel { ActualCubicMetres = string.Empty, ActualDate = string.Empty, ActualKilograms = string.Empty, ActualLitres = string.Empty, ActualTonnes = string.Empty, IsNotSpecialHandling = false, IsSpecialHandling = true, NotificationNumber = notification.NotificationNumber, Number = "0", PhysicalCharacteristics = "4", CA = "GB01 - EA" }.Evaluate(result); }
public void CantSetOtherDescriptionToEmptyString() { Action createPhysicalCharacteristic = () => PhysicalCharacteristicsInfo.CreateOtherPhysicalCharacteristicsInfo(string.Empty); Assert.Throws <ArgumentException>("otherDescription", createPhysicalCharacteristic); }
public void SetsAllProperties() { movement.Date = new DateTime(2025, 5, 2); movement.Number = 12; movementDetails.ActualQuantity = new ShipmentQuantity(30.7m, ShipmentQuantityUnits.Kilograms); notification.NotificationNumber = "GB 001 00250"; notification.HasSpecialHandlingRequirements = false; notification.PhysicalCharacteristics = new[] { PhysicalCharacteristicsInfo.CreatePhysicalCharacteristicsInfo(PhysicalCharacteristicType.Sludgy), PhysicalCharacteristicsInfo.CreateOtherPhysicalCharacteristicsInfo("Pastel"), PhysicalCharacteristicsInfo.CreatePhysicalCharacteristicsInfo(PhysicalCharacteristicType.Powdery) }; movement.NotificationId = notification.Id; var result = GenerateViewModel(); new ExpectedMovementViewModel { ActualCubicMetres = string.Empty, ActualDate = "02.05.25", ActualKilograms = "30.7 kg", ActualLitres = string.Empty, ActualTonnes = string.Empty, IsNotSpecialHandling = true, IsSpecialHandling = false, NotificationNumber = notification.NotificationNumber, Number = "12", PhysicalCharacteristics = "1, 4, Pastel", CA = "GB01 - EA" }.Evaluate(result); }
public void CantSetOtherDescriptionToNull() { Action createPhysicalCharacteristic = () => PhysicalCharacteristicsInfo.CreateOtherPhysicalCharacteristicsInfo(null); Assert.Throws <ArgumentNullException>("otherDescription", createPhysicalCharacteristic); }
public void CantCreateOtherWithoutDescription() { Action createPhysicalCharacteristic = () => PhysicalCharacteristicsInfo.CreatePhysicalCharacteristicsInfo(PhysicalCharacteristicType.Other); Assert.Throws <InvalidOperationException>(createPhysicalCharacteristic); }
public void UpdatePhysicalCharacteristicsReplacesItems() { var physicalCharacteristics = new List <PhysicalCharacteristicsInfo> { PhysicalCharacteristicsInfo.CreateOtherPhysicalCharacteristicsInfo("description"), PhysicalCharacteristicsInfo.CreatePhysicalCharacteristicsInfo(PhysicalCharacteristicType.Gaseous) }; var newPhysicalCharacteristics = new List <PhysicalCharacteristicsInfo> { PhysicalCharacteristicsInfo.CreatePhysicalCharacteristicsInfo(PhysicalCharacteristicType.Liquid), PhysicalCharacteristicsInfo.CreatePhysicalCharacteristicsInfo(PhysicalCharacteristicType.Powdery) }; notification.SetPhysicalCharacteristics(physicalCharacteristics); notification.SetPhysicalCharacteristics(newPhysicalCharacteristics); Assert.Collection(notification.PhysicalCharacteristics, item => Assert.Equal(notification.PhysicalCharacteristics.ElementAt(0).PhysicalCharacteristic, PhysicalCharacteristicType.Liquid), item => Assert.Equal(notification.PhysicalCharacteristics.ElementAt(1).PhysicalCharacteristic, PhysicalCharacteristicType.Powdery)); }
public static NotificationApplication CreateCompleted(Guid id, Guid userId, IList <Country> countries, IList <WasteCode> wasteCodes, int number = 250) { var notification = Create(id, number); OI.SetProperty(x => x.UserId, userId, notification); notification.SetPhysicalCharacteristics(new List <PhysicalCharacteristicsInfo> { PhysicalCharacteristicsInfo.CreatePhysicalCharacteristicsInfo(PhysicalCharacteristicType.Sludgy) }); notification.SetWasteType(WasteType.CreateRdfWasteType(new[] { WasteAdditionalInformation.CreateWasteAdditionalInformation("boulder", 5, 10, WasteInformationType.Energy), WasteAdditionalInformation.CreateWasteAdditionalInformation("notes", 6, 9, WasteInformationType.AshContent) })); SetWasteCodes(notification, wasteCodes); SetProperty("WasteAdditionalInformationCollection", new List <WasteAdditionalInformation>(), notification.WasteType); notification.SetWasteAdditionalInformation(new[] { WasteAdditionalInformation.CreateWasteAdditionalInformation("Rubik's cubes", 1, 10, WasteInformationType.AshContent) }); notification.SetOperationCodes(new[] { OperationCode.R1, OperationCode.R7 }); notification.ReasonForExport = "recovery"; return(notification); }
public void CanSetPhysicalCharacteristics() { notification.SetPhysicalCharacteristics(new[] { PhysicalCharacteristicsInfo.CreateOtherPhysicalCharacteristicsInfo("package description") }); Assert.Equal(1, notification.PhysicalCharacteristics.Count()); }