public void Constructor_OutOfRangeValueAsCreationPolicyArgument_ShouldSetCreationPolicy() { // Attributes should not throw exceptions var expectations = Expectations.GetInvalidEnumValues <CreationPolicy>(); foreach (var e in expectations) { var attribute = new PartCreationPolicyAttribute(e); Assert.AreEqual(e, attribute.CreationPolicy); } }
public void Constructor2_OutOfRangeValueAsCardinalityArgument_ShouldThrowArgument() { var expectations = Expectations.GetInvalidEnumValues <ImportCardinality>(); foreach (var e in expectations) { Assert.Throws <ArgumentException>("cardinality", () => { new ContractBasedImportDefinition("ContractName", (string)null, Enumerable.Empty <KeyValuePair <string, Type> >(), e, false, false, CreationPolicy.Any); }); } }
public void Constructor2_OutOfRangeValueAsCardinalityArgument_ShouldThrowArgument() { var expectations = Expectations.GetInvalidEnumValues <ImportCardinality>(); foreach (var e in expectations) { Assert.Throws <ArgumentException>("cardinality", () => { new ImportDefinition(d => true, "", e, false, false); }); } }