public void TestDeserializeBeContractWithQuery()
        {
            var contractByJson = Validators.Generators.DeserializeBeContract(GetAddressByDogIdString());
            var contract       = BeContractsMock.GetAddressByDogId();

            BeContractEquals.AreEquals(contract, contractByJson);
        }
예제 #2
0
        public async Task TestValidateBeContractWithoutQueryMappingContractKeyFail()
        {
            try
            {
                var contract = BeContractsMock.GetAddressByDogId();
                contract.Queries[0].Mappings[0].LookupInputKey = null;

                await Validators.ValidateBeContract(contract);

                Assert.Fail("Contract should not be valid without an query mapping contractkey");
            }
            catch (BeContractException ex)
            {
                Console.WriteLine(ex);
            }
        }
예제 #3
0
        public async Task TestValidateBeContractWithQueryContractFail()
        {
            try
            {
                var contract = BeContractsMock.GetAddressByDogId();
                contract.Queries[0].Contract = null;

                await Validators.ValidateBeContract(contract);

                Assert.Fail("Contract should not be valid without an query contract");
            }
            catch (BeContractException ex)
            {
                Console.WriteLine(ex);
            }
        }
        public void TestSerializeBeContractWithQuery()
        {
            var json = Validators.Generators.SerializeBeContract(BeContractsMock.GetAddressByDogId());

            TestSerializedJson(GetAddressByDogIdString(), json);
        }
예제 #5
0
 public async Task TestValidateBeContractWithQueryMappingLookupInputKeySuccess()
 {
     var contract = BeContractsMock.GetAddressByDogId();
     await Validators.ValidateBeContract(contract);
 }