public void CanCreateOperationCodesList() { var operationCodes = OperationCodesList.CreateForNotification(recoveryImportNotification, new[] { OperationCode.R1, OperationCode.R2 }); Assert.IsType <OperationCodesList>(operationCodes); }
public void OperationCodesCantBeEmpty() { Action createOperationCodes = () => OperationCodesList.CreateForNotification(recoveryImportNotification, new OperationCode[] { }); Assert.Throws <ArgumentException>("operationCodes", createOperationCodes); }
public WasteOperationTests() { var recoveryImportNotification = new ImportNotification(NotificationType.Recovery, UKCompetentAuthority.England, "FR0001"); EntityHelper.SetEntityId(recoveryImportNotification, importNotificationId); validRCodesList = OperationCodesList.CreateForNotification(recoveryImportNotification, new[] { OperationCode.R1, OperationCode.R2 }); }
public WasteOperation(Guid importNotificationId, OperationCodesList operationCodes) { Guard.ArgumentNotDefaultValue(() => importNotificationId, importNotificationId); Guard.ArgumentNotNull(() => operationCodes, operationCodes); ImportNotificationId = importNotificationId; OperationCodesCollection = new List<WasteOperationCode>(operationCodes); }
public WasteOperationTests() { var recoveryImportNotification = new ImportNotification(NotificationType.Recovery, UKCompetentAuthority.England, "FR0001"); EntityHelper.SetEntityId(recoveryImportNotification, importNotificationId); validRCodesList = OperationCodesList.CreateForNotification(recoveryImportNotification, new[] { OperationCode.R1, OperationCode.R2 }); anotherValidRCodesList = OperationCodesList.CreateForNotification(recoveryImportNotification, new[] { OperationCode.R10, OperationCode.R13 }); }
public void OperationCodesMustBeUnique() { Action createOperationCodes = () => OperationCodesList.CreateForNotification(recoveryImportNotification, new[] { OperationCode.R1, OperationCode.R1 }); Assert.Throws <ArgumentException>("operationCodes", createOperationCodes); }
public void CantHaveRecoveryCodesOnDisposalNotification() { Action createOperationCodes = () => OperationCodesList.CreateForNotification(disposalImportNotification, new[] { OperationCode.R1, OperationCode.R2 }); Assert.Throws <ArgumentException>("operationCodes", createOperationCodes); }
public Domain.ImportNotification.WasteOperation Map(WasteOperation source, ImportNotification parameter) { var wasteOperation = new Domain.ImportNotification.WasteOperation(source.ImportNotificationId, OperationCodesList.CreateForNotification(parameter, source.OperationCodes.Select(o => (OperationCode)o))); if (!string.IsNullOrWhiteSpace(source.TechnologyEmployed)) { wasteOperation.SetTechnologyEmployed(source.TechnologyEmployed); } return(wasteOperation); }