コード例 #1
0
        public void Should_get_data_token_if_DataContractAttribute_is_found_with_name_and_namespace()
        {
            var tokenProvider = new DataContractTypeTokenProvider();

            Assert.AreEqual(
                            tokenProvider.GetTypeToken<TestClassWithDataContractAttributeWithNameAndNamespace>(),
                            String.Format("{0}|{1}", TestClassNamespace, TestClassName));
        }
コード例 #2
0
        public void Should_get_data_token_if_DataContractAttribute_is_found()
        {
            var tokenProvider = new DataContractTypeTokenProvider();

            Assert.AreEqual(
                            tokenProvider.GetTypeToken<TestClassWithDataContractAttribute>(),
                            (typeof (TestClassWithDataContractAttribute).Name));
        }
コード例 #3
0
        public void Should_get_null_data_token_if_DataContractAttribute_is_not_found_on_target_type()
        {
            var tokenProvider = new DataContractTypeTokenProvider();

            Assert.IsNull(tokenProvider.GetTypeToken <TestClassWithoutDataContractAttribute>());
        }
コード例 #4
0
        public void Should_get_data_token_if_DataContractAttribute_is_found_with_name()
        {
            var tokenProvider = new DataContractTypeTokenProvider();

            Assert.AreEqual(tokenProvider.GetTypeToken <TestClassWithDataContractAttributeWithName>(), TestClassName);
        }
コード例 #5
0
 public void Should_get_null_data_token_if_DataContractAttribute_is_not_found_on_target_type()
 {
     var tokenProvider = new DataContractTypeTokenProvider();
     Assert.IsNull(tokenProvider.GetTypeToken<TestClassWithoutDataContractAttribute>());
 }
コード例 #6
0
 public void Should_get_data_token_if_DataContractAttribute_is_found_with_name()
 {
     var tokenProvider = new DataContractTypeTokenProvider();
     Assert.AreEqual(tokenProvider.GetTypeToken<TestClassWithDataContractAttributeWithName>(), TestClassName);
 }