public void TestDeserializeBeContractWithQuery() { var contractByJson = Validators.Generators.DeserializeBeContract(GetAddressByDogIdString()); var contract = BeContractsMock.GetAddressByDogId(); BeContractEquals.AreEquals(contract, contractByJson); }
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); } }
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); }
public async Task TestValidateBeContractWithQueryMappingLookupInputKeySuccess() { var contract = BeContractsMock.GetAddressByDogId(); await Validators.ValidateBeContract(contract); }