Пример #1
0
        public void CanCreateOperationCodesList()
        {
            var operationCodes = OperationCodesList.CreateForNotification(recoveryImportNotification,
                                                                          new[] { OperationCode.R1, OperationCode.R2 });

            Assert.IsType <OperationCodesList>(operationCodes);
        }
Пример #2
0
        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 });
        }
Пример #4
0
        public WasteOperation(Guid importNotificationId, OperationCodesList operationCodes)
        {
            Guard.ArgumentNotDefaultValue(() => importNotificationId, importNotificationId);
            Guard.ArgumentNotNull(() => operationCodes, operationCodes);

            ImportNotificationId = importNotificationId;
            OperationCodesCollection = new List<WasteOperationCode>(operationCodes);
        }
Пример #5
0
        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 });
        }
Пример #6
0
        public void OperationCodesMustBeUnique()
        {
            Action createOperationCodes =
                () =>
                OperationCodesList.CreateForNotification(recoveryImportNotification,
                                                         new[]
            {
                OperationCode.R1, OperationCode.R1
            });

            Assert.Throws <ArgumentException>("operationCodes", createOperationCodes);
        }
Пример #7
0
        public void CantHaveRecoveryCodesOnDisposalNotification()
        {
            Action createOperationCodes =
                () =>
                OperationCodesList.CreateForNotification(disposalImportNotification,
                                                         new[]
            {
                OperationCode.R1, OperationCode.R2
            });

            Assert.Throws <ArgumentException>("operationCodes", createOperationCodes);
        }
Пример #8
0
        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);
        }