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 ApiAdminRequestModel(); createModel.SetProperties("B", "B", "B", "B", "B", "B"); CreateResponse <ApiAdminResponseModel> createResult = await client.AdminCreateAsync(createModel); createResult.Success.Should().BeTrue(); ApiAdminResponseModel getResponse = await client.AdminGetAsync(2); getResponse.Should().NotBeNull(); ActionResponse deleteResult = await client.AdminDeleteAsync(2); deleteResult.Success.Should().BeTrue(); ApiAdminResponseModel verifyResponse = await client.AdminGetAsync(2); verifyResponse.Should().BeNull(); }
private async Task <ApiAdminResponseModel> CreateRecord() { var model = new ApiAdminRequestModel(); model.SetProperties(DateTime.Parse("1/1/1988 12:00:00 AM"), "B", "B", "B", "B", 1); CreateResponse <ApiAdminResponseModel> result = await this.Client.AdminCreateAsync(model); result.Success.Should().BeTrue(); return(result.Record); }
private async Task <ApiAdminResponseModel> CreateRecord(ApiClient client) { var model = new ApiAdminRequestModel(); model.SetProperties("B", "B", "B", "B", "B", "B"); CreateResponse <ApiAdminResponseModel> result = await client.AdminCreateAsync(model); result.Success.Should().BeTrue(); return(result.Record); }
public void MapModelToBO() { var mapper = new BOLAdminMapper(); ApiAdminRequestModel model = new ApiAdminRequestModel(); model.SetProperties(DateTime.Parse("1/1/1987 12:00:00 AM"), "A", "A", "A", "A", 1); BOAdmin response = mapper.MapModelToBO(1, model); response.Birthday.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.Email.Should().Be("A"); response.FirstName.Should().Be("A"); response.LastName.Should().Be("A"); response.Phone.Should().Be("A"); response.UserId.Should().Be(1); }
public void MapModelToBO() { var mapper = new BOLAdminMapper(); ApiAdminRequestModel model = new ApiAdminRequestModel(); model.SetProperties("A", "A", "A", "A", "A", "A"); BOAdmin response = mapper.MapModelToBO(1, model); response.Email.Should().Be("A"); response.FirstName.Should().Be("A"); response.LastName.Should().Be("A"); response.Password.Should().Be("A"); response.Phone.Should().Be("A"); response.Username.Should().Be("A"); }
public void MapRequestToResponse() { var mapper = new ApiAdminModelMapper(); var model = new ApiAdminRequestModel(); model.SetProperties(DateTime.Parse("1/1/1987 12:00:00 AM"), "A", "A", "A", "A", 1); ApiAdminResponseModel response = mapper.MapRequestToResponse(1, model); response.Birthday.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.Email.Should().Be("A"); response.FirstName.Should().Be("A"); response.Id.Should().Be(1); response.LastName.Should().Be("A"); response.Phone.Should().Be("A"); response.StudioId.Should().Be(1); }
public void MapRequestToResponse() { var mapper = new ApiAdminModelMapper(); var model = new ApiAdminRequestModel(); model.SetProperties("A", "A", "A", "A", "A", "A"); ApiAdminResponseModel response = mapper.MapRequestToResponse(1, model); response.Email.Should().Be("A"); response.FirstName.Should().Be("A"); response.Id.Should().Be(1); response.LastName.Should().Be("A"); response.Password.Should().Be("A"); response.Phone.Should().Be("A"); response.Username.Should().Be("A"); }
public void CreatePatch() { var mapper = new ApiAdminModelMapper(); var model = new ApiAdminRequestModel(); model.SetProperties(DateTime.Parse("1/1/1987 12:00:00 AM"), "A", "A", "A", "A", 1); JsonPatchDocument <ApiAdminRequestModel> patch = mapper.CreatePatch(model); var response = new ApiAdminRequestModel(); patch.ApplyTo(response); response.Birthday.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.Email.Should().Be("A"); response.FirstName.Should().Be("A"); response.LastName.Should().Be("A"); response.Phone.Should().Be("A"); response.StudioId.Should().Be(1); }
public void CreatePatch() { var mapper = new ApiAdminModelMapper(); var model = new ApiAdminRequestModel(); model.SetProperties("A", "A", "A", "A", "A", "A"); JsonPatchDocument <ApiAdminRequestModel> patch = mapper.CreatePatch(model); var response = new ApiAdminRequestModel(); patch.ApplyTo(response); response.Email.Should().Be("A"); response.FirstName.Should().Be("A"); response.LastName.Should().Be("A"); response.Password.Should().Be("A"); response.Phone.Should().Be("A"); response.Username.Should().Be("A"); }