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 ApiLinkTypeRequestModel(); createModel.SetProperties("B"); CreateResponse <ApiLinkTypeResponseModel> createResult = await client.LinkTypeCreateAsync(createModel); createResult.Success.Should().BeTrue(); ApiLinkTypeResponseModel getResponse = await client.LinkTypeGetAsync(2); getResponse.Should().NotBeNull(); ActionResponse deleteResult = await client.LinkTypeDeleteAsync(2); deleteResult.Success.Should().BeTrue(); ApiLinkTypeResponseModel verifyResponse = await client.LinkTypeGetAsync(2); verifyResponse.Should().BeNull(); }
public void MapModelToBO() { var mapper = new BOLLinkTypeMapper(); ApiLinkTypeRequestModel model = new ApiLinkTypeRequestModel(); model.SetProperties("A"); BOLinkType response = mapper.MapModelToBO(1, model); response.Type.Should().Be("A"); }
private async Task <ApiLinkTypeResponseModel> CreateRecord(ApiClient client) { var model = new ApiLinkTypeRequestModel(); model.SetProperties("B"); CreateResponse <ApiLinkTypeResponseModel> result = await client.LinkTypeCreateAsync(model); result.Success.Should().BeTrue(); return(result.Record); }
public void MapRequestToResponse() { var mapper = new ApiLinkTypeModelMapper(); var model = new ApiLinkTypeRequestModel(); model.SetProperties("A"); ApiLinkTypeResponseModel response = mapper.MapRequestToResponse(1, model); response.Id.Should().Be(1); response.Type.Should().Be("A"); }
public void CreatePatch() { var mapper = new ApiLinkTypeModelMapper(); var model = new ApiLinkTypeRequestModel(); model.SetProperties("A"); JsonPatchDocument <ApiLinkTypeRequestModel> patch = mapper.CreatePatch(model); var response = new ApiLinkTypeRequestModel(); patch.ApplyTo(response); response.Type.Should().Be("A"); }