Пример #1
0
        public void MapResponseToRequest()
        {
            var mapper = new ApiEmployeePayHistoryModelMapper();
            var model  = new ApiEmployeePayHistoryResponseModel();

            model.SetProperties(1, DateTime.Parse("1/1/1987 12:00:00 AM"), 1, 1m, DateTime.Parse("1/1/1987 12:00:00 AM"));
            ApiEmployeePayHistoryRequestModel response = mapper.MapResponseToRequest(model);

            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.PayFrequency.Should().Be(1);
            response.Rate.Should().Be(1m);
            response.RateChangeDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
        }
Пример #2
0
        public async void TestUpdate()
        {
            var model = await this.CreateRecord();

            ApiEmployeePayHistoryModelMapper mapper = new ApiEmployeePayHistoryModelMapper();

            UpdateResponse <ApiEmployeePayHistoryResponseModel> updateResponse = await this.Client.EmployeePayHistoryUpdateAsync(model.BusinessEntityID, mapper.MapResponseToRequest(model));

            updateResponse.Record.Should().NotBeNull();
            updateResponse.Success.Should().BeTrue();

            await this.Cleanup();
        }
Пример #3
0
        public async void TestUpdate()
        {
            var builder = new WebHostBuilder()
                          .UseEnvironment("Production")
                          .UseStartup <TestStartup>();
            TestServer testServer = new TestServer(builder);

            var client = new ApiClient(testServer.CreateClient());

            ApiEmployeePayHistoryResponseModel model = await client.EmployeePayHistoryGetAsync(1);

            ApiEmployeePayHistoryModelMapper mapper = new ApiEmployeePayHistoryModelMapper();

            UpdateResponse <ApiEmployeePayHistoryResponseModel> updateResponse = await client.EmployeePayHistoryUpdateAsync(model.BusinessEntityID, mapper.MapResponseToRequest(model));

            updateResponse.Record.Should().NotBeNull();
            updateResponse.Success.Should().BeTrue();
        }