예제 #1
0
        public void Constructor4_ValueAsContractNameArgument_ShouldSetDefinitionContractNameProperty()
        {
            var expectations = Expectations.GetContractNames();

            foreach (var e in expectations)
            {
                var export = new Export(e, new Dictionary <string, object>(), () => null);

                Assert.AreEqual(e, export.Definition.ContractName);
            }
        }
예제 #2
0
        public void Constraint_ShouldIncludeContractNameProperty()
        {
            var expectations = Expectations.GetContractNames();

            foreach (var e in expectations)
            {
                var definition = new ContractBasedImportDefinition(e, (string)null, (IEnumerable <KeyValuePair <string, Type> >)null, ImportCardinality.ExactlyOne, true, false, CreationPolicy.Any);

                ConstraintAssert.Contains(definition.Constraint, e);
            }
        }
예제 #3
0
        public void Constraint_ShouldIncludeOverriddenContractNameProperty()
        {
            var expectations = Expectations.GetContractNames();

            foreach (var e in expectations)
            {
                var definition = new DerivedContractBasedImportDefinition(e);

                ConstraintAssert.Contains(definition.Constraint, e);
            }
        }
예제 #4
0
        public void Constructor2_ValueAsContractNameArgument_ShouldSetContractNameProperty()
        {
            var expectations = Expectations.GetContractNames();

            foreach (var e in expectations)
            {
                var definition = new ContractBasedImportDefinition(e, (string)null, Enumerable.Empty <KeyValuePair <string, Type> >(), ImportCardinality.ExactlyOne, false, false, CreationPolicy.Any);

                Assert.Equal(e, definition.ContractName);
            }
        }
        public void Constructor2_ValueAsContractNameArgument_ShouldSetContractNameProperty()
        {
            var expectations = Expectations.GetContractNames();

            foreach (var e in expectations)
            {
                var definition = new ExportDefinition(e, new Dictionary <string, object>());

                Assert.Equal(e, definition.ContractName);
            }
        }
        public void ToString_ShouldReturnContractNameProperty()
        {
            var expectations = Expectations.GetContractNames();

            foreach (var e in expectations)
            {
                var definition = new ExportDefinition(e, new Dictionary <string, object>());

                Assert.Equal(e, definition.ToString());
            }
        }
예제 #7
0
        public void Constructor3_ValueAsContractNameArgument_ShouldSetDefinitionContractNameProperty()
        {
            var expectations = Expectations.GetContractNames();

            foreach (var e in expectations)
            {
                var export = new Export(e, () => null);

                Assert.Equal(e, export.Definition.ContractName);
            }
        }
예제 #8
0
        public void TryParseConstraint_ConstraintFromCreateConstraintAsConstraintArgument3_CanParse()
        {
            var contractNames  = Expectations.GetContractNames();
            var metadataValues = Expectations.GetRequiredMetadata();

            foreach (var contractName in contractNames)
            {
                foreach (var metadataValue in metadataValues)
                {
                    var constraint = ConstraintServices.CreateConstraint(contractName, null, metadataValue, CreationPolicy.Any);

                    AssertCanParse(constraint, contractName, metadataValue);
                }
            }
        }