public void Getting_contract_name_with_datacontract_attribute_for_registered_type_returns_defined_name()
        {
            var fakeContractType = typeof(FakeContract1);
            var sut = new DefaultContractsRegistry(fakeContractType.Assembly);

            var contractName = sut.GetContractName(fakeContractType);

            Assert.Equal(contractName, "FakeContract1");
        }
        public void Getting_contract_name_without_datacontract_attribute_for_registered_type_returns_type_fullname()
        {
            var fakeContractType = typeof(FakeContractWithoutDataContract);
            var sut = new DefaultContractsRegistry(fakeContractType.Assembly);

            var contractName = sut.GetContractName(fakeContractType);

            Assert.Equal(contractName, fakeContractType.FullName);
        }
        public void Getting_contract_name_for_not_registered_type_throws_NullReferenceException()
        {
            var sut = new DefaultContractsRegistry();

            Assert.Throws <NullReferenceException>(() =>
            {
                sut.GetContractName(typeof(string));
            });
        }