public void EwcCodeNull_Throws() { Assert.Throws <ArgumentNullException>(() => new WasteType(ImportNotificationId, "WasteTypeName", BaselOecdCode.CreateNotListed(), null, YCode.CreateNotApplicable(), HCode.CreateNotApplicable(), UnClass.CreateNotApplicable(), ChemicalComposition.Other)); }
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)); }
public void UnClassNotApplicable_NotApplicableTrue() { var wasteType = new WasteType(ImportNotificationId, "WasteTypeName", BaselOecdCode.CreateNotListed(), EwcCode.CreateFor(new[] { AnyWasteCode(CodeType.Ewc) }), YCode.CreateNotApplicable(), HCode.CreateNotApplicable(), UnClass.CreateNotApplicable(), ChemicalComposition.Other); Assert.True(wasteType.UnClassNotApplicable); }
public void UnsetChemicalComposition_Throws() { Assert.Throws <ArgumentException>(() => new WasteType(ImportNotificationId, "Name", BaselOecdCode.CreateNotListed(), EwcCode.CreateFor(new[] { AnyWasteCode(CodeType.Ewc) }), YCode.CreateNotApplicable(), HCode.CreateNotApplicable(), UnClass.CreateNotApplicable(), default(ChemicalComposition))); }
public void UnClassNull_Throws() { Assert.Throws <ArgumentNullException>(() => new WasteType(ImportNotificationId, "WasteTypeName", BaselOecdCode.CreateNotListed(), EwcCode.CreateFor(new[] { AnyWasteCode(CodeType.Ewc) }), YCode.CreateNotApplicable(), HCode.CreateNotApplicable(), null, ChemicalComposition.Other)); }
public void ImportNotificationIdDefaultValue_Throws() { Assert.Throws <ArgumentException>(() => new WasteType(Guid.Empty, "WasteTypeName", BaselOecdCode.CreateNotListed(), EwcCode.CreateFor(new[] { AnyWasteCode(CodeType.Ewc) }), YCode.CreateNotApplicable(), HCode.CreateNotApplicable(), UnClass.CreateNotApplicable(), ChemicalComposition.Other)); }
public void UnClassesAreSet() { var unCode = AnyWasteCode(CodeType.Un); var unCodeId = new Guid("4B50E7AA-0136-444A-9185-FE31BE6CF98E"); ObjectInstantiator <WasteCode> .SetProperty(x => x.Id, unCodeId, unCode); var wasteType = new WasteType(ImportNotificationId, "WateTypeName", BaselOecdCode.CreateNotListed(), EwcCode.CreateFor(new[] { AnyWasteCode(CodeType.Ewc) }), YCode.CreateNotApplicable(), HCode.CreateNotApplicable(), UnClass.CreateFor(new[] { unCode }), ChemicalComposition.Other); Assert.Equal(1, wasteType.WasteCodes.Count(wc => wc.WasteCodeId == unCodeId)); }
public void YCodesAreSet() { var yCode = AnyWasteCode(CodeType.Y); var yCodeId = new Guid("F416BD1D-56E9-45D8-9A4E-7476DF201AB2"); ObjectInstantiator <WasteCode> .SetProperty(x => x.Id, yCodeId, yCode); var wasteType = new WasteType(ImportNotificationId, "WateTypeName", BaselOecdCode.CreateNotListed(), EwcCode.CreateFor(new[] { AnyWasteCode(CodeType.Ewc) }), YCode.CreateFor(new[] { yCode }), HCode.CreateNotApplicable(), UnClass.CreateNotApplicable(), ChemicalComposition.Other); Assert.Equal(1, wasteType.WasteCodes.Count(wc => wc.WasteCodeId == yCodeId)); }
public void EwcCodesAreSet() { var ewcCode = AnyWasteCode(CodeType.Ewc); var ewcCodeId = new Guid("A4DA3323-B6BD-4245-B144-B9E05661BEC6"); ObjectInstantiator <WasteCode> .SetProperty(x => x.Id, ewcCodeId, ewcCode); var wasteType = new WasteType(ImportNotificationId, "WateTypeName", BaselOecdCode.CreateNotListed(), EwcCode.CreateFor(new[] { ewcCode }), YCode.CreateNotApplicable(), HCode.CreateNotApplicable(), UnClass.CreateNotApplicable(), ChemicalComposition.Other); Assert.Equal(1, wasteType.WasteCodes.Count(wc => wc.WasteCodeId == ewcCodeId)); }
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)); }
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)); }