Пример #1
0
        public void GetExportContractName_should_be_virtual()
        {
            var method =
                ReflectionServices.GetMethod <DefaultConventionContractService>(x => x.GetExportContractName(null, null));

            IsMethodVirtual(method).ShouldBeTrue();
        }
Пример #2
0
        public void GetExportContractName_should_return_type_identity_of_method_type_when_called_with_method_and_contract_name_and_type_are_null()
        {
            var member =
                ReflectionServices.GetMethod <FakePart>(x => x.DoWork());

            var convention =
                new ExportConvention
            {
                ContractName = null,
                ContractType = null,
                Members      = x => new[] { member }
            };

            var results =
                this.Service.GetExportContractName(convention, member);

            var expectedContractName =
                AttributedModelServices.GetTypeIdentity(member);

            results.ShouldEqual(expectedContractName);
        }
        public void GetExportTypeIdentity_should_return_type_identify_of_method_when_called_with_method_member_and_convention_contract_type_is_null()
        {
            var convention =
                new ExportConvention
            {
                ContractName = null,
                ContractType = null
            };

            var member =
                ReflectionServices.GetMethod <FakePart>(x => x.DoWork());

            var service =
                GetServiceWithoutDefaultConventions();

            var result =
                service.GetExportTypeIdentity(convention, member);

            var expectedTypeIdentity =
                AttributedModelServices.GetTypeIdentity(member);

            result.ShouldEqual(expectedTypeIdentity);
        }