public async Task Layout_Parameter_Should_Override_Model_Attribute() { var fdc = GetDataClientWithMockedHandler(); var newModel = new ModelWithLayout() { Name = "Fuzzzerd", AnotherField = "Different Value" }; var response = await fdc.CreateAsync(layout, newModel); Assert.NotNull(response); Assert.Contains(response.Messages, r => r.Message == "OK"); }
public async Task CreateWithTableAttribute_ShouldReturnOK() { var mockHttp = new MockHttpMessageHandler(); // since we know 'ModelWithLayout' uses 'Somelayout' as its layout we need to ensure a response for that endpoint mockHttp.When(HttpMethod.Post, $"{s_server}/fmi/data/v1/databases/{s_file}/layouts/Somelayout/records*") .WithPartialContent("fieldData") // make sure that the body content contains the 'data' object expected by fms .Respond("application/json", DataApiResponses.SuccessfulCreate()); var fdc = GetDataClientWithMockedHandler(mockHttp); var newModel = new ModelWithLayout() { Name = "Fuzzzerd", AnotherField = "Different Value" }; var response = await fdc.CreateAsync(newModel); Assert.NotNull(response); Assert.Contains(response.Messages, r => r.Message == "OK"); }