public async void TestDelete() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); var createModel = new ApiColumnSameAsFKTableRequestModel(); createModel.SetProperties(2, 2); CreateResponse <ApiColumnSameAsFKTableResponseModel> createResult = await client.ColumnSameAsFKTableCreateAsync(createModel); createResult.Success.Should().BeTrue(); ApiColumnSameAsFKTableResponseModel getResponse = await client.ColumnSameAsFKTableGetAsync(2); getResponse.Should().NotBeNull(); ActionResponse deleteResult = await client.ColumnSameAsFKTableDeleteAsync(2); deleteResult.Success.Should().BeTrue(); ApiColumnSameAsFKTableResponseModel verifyResponse = await client.ColumnSameAsFKTableGetAsync(2); verifyResponse.Should().BeNull(); }
private async Task <ApiColumnSameAsFKTableResponseModel> CreateRecord(ApiClient client) { var model = new ApiColumnSameAsFKTableRequestModel(); model.SetProperties(2, 2); CreateResponse <ApiColumnSameAsFKTableResponseModel> result = await client.ColumnSameAsFKTableCreateAsync(model); result.Success.Should().BeTrue(); return(result.Record); }
public void MapModelToBO() { var mapper = new BOLColumnSameAsFKTableMapper(); ApiColumnSameAsFKTableRequestModel model = new ApiColumnSameAsFKTableRequestModel(); model.SetProperties(1, 1); BOColumnSameAsFKTable response = mapper.MapModelToBO(1, model); response.Person.Should().Be(1); response.PersonId.Should().Be(1); }
public void MapRequestToResponse() { var mapper = new ApiColumnSameAsFKTableModelMapper(); var model = new ApiColumnSameAsFKTableRequestModel(); model.SetProperties(1, 1); ApiColumnSameAsFKTableResponseModel response = mapper.MapRequestToResponse(1, model); response.Id.Should().Be(1); response.Person.Should().Be(1); response.PersonId.Should().Be(1); }
public void CreatePatch() { var mapper = new ApiColumnSameAsFKTableModelMapper(); var model = new ApiColumnSameAsFKTableRequestModel(); model.SetProperties(1, 1); JsonPatchDocument <ApiColumnSameAsFKTableRequestModel> patch = mapper.CreatePatch(model); var response = new ApiColumnSameAsFKTableRequestModel(); patch.ApplyTo(response); response.Person.Should().Be(1); response.PersonId.Should().Be(1); }