示例#1
0
 private static async Task InsertSupplierContactAsync(SupplierContactTable supplierTable)
 {
     await SupplierContactEntityBuilder.Create()
     .WithId(supplierTable.Id)
     .WithSupplierId(supplierTable.SupplierId)
     .WithFirstName(supplierTable.FirstName)
     .WithLastName(supplierTable.LastName)
     .WithEmail(supplierTable.Email)
     .WithPhoneNumber(supplierTable.PhoneNumber)
     .Build()
     .InsertAsync();
 }
示例#2
0
        public async Task ThenTheResponseContainsTheFollowingSupplierContactDetails(Table table)
        {
            var response = await _response.ReadBodyAsJsonAsync();

            var primaryContactResponse = response.SelectToken("primaryContact");

            Assert.IsNotNull(primaryContactResponse);

            var actual = new SupplierContactTable
            {
                FirstName = primaryContactResponse.Value <string>("firstName"),
                LastName  = primaryContactResponse.Value <string>("lastName"),
                Email     = primaryContactResponse.Value <string>("emailAddress"),
                Phone     = primaryContactResponse.Value <string>("telephoneNumber")
            };

            var expected = table.CreateInstance <SupplierContactTable>();

            actual.Should().BeEquivalentTo(expected);
        }