Beispiel #1
0
        public void CanCreateWasteType()
        {
            var wasteType = new WasteType(ImportNotificationId,
                                          "WasteTypeName",
                                          BaselOecdCode.CreateFor(AnyWasteCode(CodeType.Basel)),
                                          EwcCode.CreateFor(new[] { AnyWasteCode(CodeType.Ewc) }),
                                          YCode.CreateFor(new[] { AnyWasteCode(CodeType.Y) }),
                                          HCode.CreateFor(new[] { AnyWasteCode(CodeType.H) }),
                                          UnClass.CreateFor(new[] { AnyWasteCode(CodeType.Un) }),
                                          ChemicalComposition.Other);

            Assert.IsType <WasteType>(wasteType);
        }
Beispiel #2
0
        private BaselOecdCode CreateBaselCode(bool notListed, Guid?codeId)
        {
            if (notListed)
            {
                return(BaselOecdCode.CreateNotListed());
            }

            if (!codeId.HasValue)
            {
                throw new ArgumentNullException("codeId must not be null when basel/oecd code isn't 'not listed'");
            }

            var wasteCode = Task.Run(() => wasteCodeRepository.GetWasteCodesByIds(new[] { codeId.Value })).Result.Single();

            return(BaselOecdCode.CreateFor(wasteCode));
        }
Beispiel #3
0
        public void OecdCodeIsSet()
        {
            var oecdCode   = AnyWasteCode(CodeType.Oecd);
            var oecdCodeId = new Guid("A58E7CE8-FA46-4E35-A3ED-26E395678CA0");

            ObjectInstantiator <WasteCode> .SetProperty(x => x.Id, oecdCodeId, oecdCode);

            var wasteType = new WasteType(ImportNotificationId,
                                          "WasteTypeName",
                                          BaselOecdCode.CreateFor(oecdCode),
                                          EwcCode.CreateFor(new[] { AnyWasteCode(CodeType.Ewc) }),
                                          YCode.CreateNotApplicable(),
                                          HCode.CreateNotApplicable(),
                                          UnClass.CreateNotApplicable(),
                                          ChemicalComposition.Other);

            Assert.Equal(1, wasteType.WasteCodes.Count(wc => wc.WasteCodeId == oecdCodeId));
        }
Beispiel #4
0
        public void BaselCodeIsSet()
        {
            var baselCode   = AnyWasteCode(CodeType.Basel);
            var baselCodeId = new Guid("72669DEE-1126-47B3-8C45-2395F54C82D8");

            ObjectInstantiator <WasteCode> .SetProperty(x => x.Id, baselCodeId, baselCode);

            var wasteType = new WasteType(ImportNotificationId,
                                          "WasteTypeName",
                                          BaselOecdCode.CreateFor(baselCode),
                                          EwcCode.CreateFor(new[] { AnyWasteCode(CodeType.Ewc) }),
                                          YCode.CreateNotApplicable(),
                                          HCode.CreateNotApplicable(),
                                          UnClass.CreateNotApplicable(),
                                          ChemicalComposition.Other);

            Assert.Equal(1, wasteType.WasteCodes.Count(wc => wc.WasteCodeId == baselCodeId));
        }
Beispiel #5
0
 public void BaselOecdCode_CreateFor_Null_Throws()
 {
     Assert.Throws <ArgumentNullException>(() => BaselOecdCode.CreateFor(null));
 }
Beispiel #6
0
 public void BaselCodeTypeNotBaselOecd_Throws(CodeType codeType)
 {
     Assert.Throws <ArgumentException>(() => BaselOecdCode.CreateFor(AnyWasteCode(codeType)));
 }