示例#1
0
        public void ContractName_should_throw_argumentnullexception_if_called_with_null()
        {
            var builder =
                new TypeDefaultConventionBuilder(typeof(string));

            var exception =
                Catch.Exception(() => builder.ContractName(null));

            exception.ShouldBeOfType <ArgumentNullException>();
        }
示例#2
0
        public void ContractType_should_return_reference_to_itself()
        {
            var builder =
                new TypeDefaultConventionBuilder(typeof(string));

            var reference = builder
                            .ContractType <int>();

            reference.ShouldBeSameAs(builder);
        }
示例#3
0
        public void ContractName_should_throw_argumentoutofrangeexception_if_called_wiht_empty_string()
        {
            var builder =
                new TypeDefaultConventionBuilder(typeof(string));

            var exception =
                Catch.Exception(() => builder.ContractName(string.Empty));

            exception.ShouldBeOfType <ArgumentOutOfRangeException>();
        }
示例#4
0
        public void Ctor_should_persist_target_type_to_target_type_property()
        {
            var builder =
                new TypeDefaultConventionBuilder(typeof(string));

            var convention =
                builder.GetConvention();

            convention.TargetType.ShouldBeOfType <string>();
        }
        public void ContractName_should_throw_argumentoutofrangeexception_if_called_wiht_empty_string()
        {
            var builder =
                new TypeDefaultConventionBuilder(typeof(string));

            var exception =
                Catch.Exception(() => builder.ContractName(string.Empty));

            exception.ShouldBeOfType<ArgumentOutOfRangeException>();
        }
        public void ContractName_should_throw_argumentnullexception_if_called_with_null()
        {
            var builder =
                new TypeDefaultConventionBuilder(typeof(string));

            var exception =
                Catch.Exception(() => builder.ContractName(null));

            exception.ShouldBeOfType<ArgumentNullException>();
        }
        public void Ctor_should_persist_target_type_to_target_type_property()
        {
            var builder =
                new TypeDefaultConventionBuilder(typeof(string));

            var convention =
                builder.GetConvention();

            convention.TargetType.ShouldBeOfType<string>();
        }
示例#8
0
        public void ContractName_should_return_reference_to_itself()
        {
            const string contractName = "Contract";

            var builder =
                new TypeDefaultConventionBuilder(typeof(string));

            var reference = builder
                            .ContractName(contractName);

            reference.ShouldBeSameAs(builder);
        }
        public void ContractName_should_return_reference_to_itself()
        {
            const string contractName = "Contract";

            var builder =
                new TypeDefaultConventionBuilder(typeof(string));

            var reference = builder
                .ContractName(contractName);

            reference.ShouldBeSameAs(builder);
        }
示例#10
0
        public void ContractType_should_persist_type_in_contract_type_property()
        {
            var builder =
                new TypeDefaultConventionBuilder(typeof(string));

            builder
            .ContractType <int>();

            var convention =
                builder.GetConvention();

            convention.ContractType.ShouldBeOfType <int>();
        }
示例#11
0
        public void ContractName_should_persist_name_in_contract_name_property()
        {
            const string contractName = "Contract";

            var builder =
                new TypeDefaultConventionBuilder(typeof(string));

            builder
            .ContractName(contractName);

            var convention =
                builder.GetConvention();

            convention.ContractName.ShouldEqual(contractName);
        }
        public void ContractName_should_persist_name_in_contract_name_property()
        {
            const string contractName = "Contract";

            var builder =
                new TypeDefaultConventionBuilder(typeof(string));

            builder
                .ContractName(contractName);
            
            var convention =
                builder.GetConvention();

            convention.ContractName.ShouldEqual(contractName);
        }
        public void ContractType_should_persist_type_in_contract_type_property()
        {
            var builder =
                new TypeDefaultConventionBuilder(typeof(string));

            builder
                .ContractType<int>();

            var convention =
                builder.GetConvention();

            convention.ContractType.ShouldBeOfType<int>();
        }
        public void ContractType_should_return_reference_to_itself()
        {
            var builder =
                new TypeDefaultConventionBuilder(typeof(string));

            var reference = builder
                .ContractType<int>();

            reference.ShouldBeSameAs(builder);
        }