public async void TestUpdate() { var model = await this.CreateRecord(); ApiEventModelMapper mapper = new ApiEventModelMapper(); UpdateResponse <ApiEventResponseModel> updateResponse = await this.Client.EventUpdateAsync(model.Id, mapper.MapResponseToRequest(model)); updateResponse.Record.Should().NotBeNull(); updateResponse.Success.Should().BeTrue(); await this.Cleanup(); }
public void MapResponseToRequest() { var mapper = new ApiEventModelMapper(); var model = new ApiEventResponseModel(); model.SetProperties(1, DateTime.Parse("1/1/1987 12:00:00 AM"), DateTime.Parse("1/1/1987 12:00:00 AM"), 1m, 1, DateTime.Parse("1/1/1987 12:00:00 AM"), DateTime.Parse("1/1/1987 12:00:00 AM"), "A", "A"); ApiEventRequestModel response = mapper.MapResponseToRequest(model); response.ActualEndDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.ActualStartDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.BillAmount.Should().Be(1m); response.EventStatusId.Should().Be(1); response.ScheduledEndDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.ScheduledStartDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.StudentNote.Should().Be("A"); response.TeacherNote.Should().Be("A"); }
public async void TestUpdate() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); ApiEventResponseModel model = await client.EventGetAsync(1); ApiEventModelMapper mapper = new ApiEventModelMapper(); UpdateResponse <ApiEventResponseModel> updateResponse = await client.EventUpdateAsync(model.Id, mapper.MapResponseToRequest(model)); updateResponse.Record.Should().NotBeNull(); updateResponse.Success.Should().BeTrue(); }
public void MapResponseToRequest() { var mapper = new ApiEventModelMapper(); var model = new ApiEventResponseModel(); model.SetProperties(1, "A", "A", 1, DateTime.Parse("1/1/1987 12:00:00 AM"), "A", DateTime.Parse("1/1/1987 12:00:00 AM"), "A", "A", DateTime.Parse("1/1/1987 12:00:00 AM"), "A"); ApiEventRequestModel response = mapper.MapResponseToRequest(model); response.Address1.Should().Be("A"); response.Address2.Should().Be("A"); response.CityId.Should().Be(1); response.Date.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.Description.Should().Be("A"); response.EndDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.Facebook.Should().Be("A"); response.Name.Should().Be("A"); response.StartDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.Website.Should().Be("A"); }
public void CreatePatch() { var mapper = new ApiEventModelMapper(); var model = new ApiEventRequestModel(); model.SetProperties(DateTime.Parse("1/1/1987 12:00:00 AM"), DateTime.Parse("1/1/1987 12:00:00 AM"), 1m, 1, DateTime.Parse("1/1/1987 12:00:00 AM"), DateTime.Parse("1/1/1987 12:00:00 AM"), "A", "A"); JsonPatchDocument <ApiEventRequestModel> patch = mapper.CreatePatch(model); var response = new ApiEventRequestModel(); patch.ApplyTo(response); response.ActualEndDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.ActualStartDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.BillAmount.Should().Be(1m); response.EventStatusId.Should().Be(1); response.ScheduledEndDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.ScheduledStartDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.StudentNote.Should().Be("A"); response.TeacherNote.Should().Be("A"); }
public void MapResponseToRequest() { var mapper = new ApiEventModelMapper(); var model = new ApiEventResponseModel(); model.SetProperties("A", 1, "A", "A", "A", "A", DateTimeOffset.Parse("1/1/1987 12:00:00 AM"), "A", "A", "A", "A", "A"); ApiEventRequestModel response = mapper.MapResponseToRequest(model); response.AutoId.Should().Be(1); response.Category.Should().Be("A"); response.EnvironmentId.Should().Be("A"); response.JSON.Should().Be("A"); response.Message.Should().Be("A"); response.Occurred.Should().Be(DateTimeOffset.Parse("1/1/1987 12:00:00 AM")); response.ProjectId.Should().Be("A"); response.RelatedDocumentIds.Should().Be("A"); response.TenantId.Should().Be("A"); response.UserId.Should().Be("A"); response.Username.Should().Be("A"); }
public void CreatePatch() { var mapper = new ApiEventModelMapper(); var model = new ApiEventRequestModel(); model.SetProperties("A", "A", 1, DateTime.Parse("1/1/1987 12:00:00 AM"), "A", DateTime.Parse("1/1/1987 12:00:00 AM"), "A", "A", DateTime.Parse("1/1/1987 12:00:00 AM"), "A"); JsonPatchDocument <ApiEventRequestModel> patch = mapper.CreatePatch(model); var response = new ApiEventRequestModel(); patch.ApplyTo(response); response.Address1.Should().Be("A"); response.Address2.Should().Be("A"); response.CityId.Should().Be(1); response.Date.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.Description.Should().Be("A"); response.EndDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.Facebook.Should().Be("A"); response.Name.Should().Be("A"); response.StartDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.Website.Should().Be("A"); }
public void CreatePatch() { var mapper = new ApiEventModelMapper(); var model = new ApiEventRequestModel(); model.SetProperties(1, "A", "A", "A", "A", DateTimeOffset.Parse("1/1/1987 12:00:00 AM"), "A", "A", "A", "A", "A"); JsonPatchDocument <ApiEventRequestModel> patch = mapper.CreatePatch(model); var response = new ApiEventRequestModel(); patch.ApplyTo(response); response.AutoId.Should().Be(1); response.Category.Should().Be("A"); response.EnvironmentId.Should().Be("A"); response.JSON.Should().Be("A"); response.Message.Should().Be("A"); response.Occurred.Should().Be(DateTimeOffset.Parse("1/1/1987 12:00:00 AM")); response.ProjectId.Should().Be("A"); response.RelatedDocumentIds.Should().Be("A"); response.TenantId.Should().Be("A"); response.UserId.Should().Be("A"); response.Username.Should().Be("A"); }