Ejemplo n.º 1
0
        private HCode CreateHCode(bool notApplicable, IEnumerable <Guid> codeIds)
        {
            if (notApplicable)
            {
                return(HCode.CreateNotApplicable());
            }

            var wasteCodes = Task.Run(() => wasteCodeRepository.GetWasteCodesByIds(codeIds)).Result;

            return(HCode.CreateFor(wasteCodes));
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
0
        public void HCodesAreSet()
        {
            var hCode   = AnyWasteCode(CodeType.H);
            var hCodeId = new Guid("B21D8610-EBB0-436F-BD26-D2F40B42B866");

            ObjectInstantiator <WasteCode> .SetProperty(x => x.Id, hCodeId, hCode);

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

            Assert.Equal(1, wasteType.WasteCodes.Count(wc => wc.WasteCodeId == hCodeId));
        }
Ejemplo n.º 4
0
 public void AnyHCodesWrongType_Throws(CodeType codeType)
 {
     Assert.Throws <ArgumentException>(() => HCode.CreateFor(new[] { AnyWasteCode(codeType) }));
 }
Ejemplo n.º 5
0
 public void HCode_CreateFor_Null_Throws()
 {
     Assert.Throws <ArgumentNullException>(() => HCode.CreateFor(null));
 }