public async Task Update_ed_returns_success()
        {
            using (var edServer = new EarningsAndDeductionsScenarioBase().CreateServer())
            {
                var edClient = edServer.CreateIdempotentClient();
                var fakesingleManualEDCommand = this.GetManualEDCommandFake(isSingleAdd: false, isValidData: true, isAdd: true);

                await edClient.PostAsync(EarningsAndDeductionsScenarioBase.Post.ManualED,
                                         new StringContent(JsonConvert.SerializeObject(fakesingleManualEDCommand), UTF8Encoding.UTF8, "application/json"));

                var records = await edClient.GetAsync(EarningsAndDeductionsScenarioBase.Get.GetRecords);

                var recordToBeUpdatedList = records.Content.ReadAsAsync <List <ManualEDCommand.EarningsAndDeductions> >().Result;

                var recordToBeUpdated = recordToBeUpdatedList.Skip(1).FirstOrDefault();
                recordToBeUpdated.PayDateTo = recordToBeUpdated.PayDateTo.AddDays(10);
                edClient = edServer.CreateIdempotentClient();

                var res = await edClient.PostAsync(EarningsAndDeductionsScenarioBase.Post.ManualED,
                                                   new StringContent(JsonConvert.SerializeObject(GetEarningsAndDeduction_Type2(recordToBeUpdated)), UTF8Encoding.UTF8, "application/json"));

                // after update the status code should be 200
                Assert.Equal(System.Net.HttpStatusCode.OK, res.StatusCode);
            }
        }
        public async Task Get_downloadTemplate()
        {
            using (var edServer = new EarningsAndDeductionsScenarioBase().CreateServer())
            {
                var edClient = edServer.CreateIdempotentClient();
                //var employeeDetails = GetNewEmployee();

                var res = await edClient.GetAsync(EarningsAndDeductionsScenarioBase.Get.DownloadTemplate);

                // after insert the status code should be 200
                Assert.Equal(System.Net.HttpStatusCode.OK, res.StatusCode);
            }
        }
        public async Task Add_MultipleED_With_InvalidData_ReturnsFailure()
        {
            using (var edServer = new EarningsAndDeductionsScenarioBase().CreateServer())
            {
                var edClient = edServer.CreateIdempotentClient();

                var fakesingleManualEDCommand = this.GetManualEDCommandFake(isSingleAdd: false, isValidData: false, isAdd: true);

                var res = await edClient.PostAsync(EarningsAndDeductionsScenarioBase.Post.ManualED,
                                                   new StringContent(JsonConvert.SerializeObject(fakesingleManualEDCommand), UTF8Encoding.UTF8, "application/json"));

                // after insert the status code should be 400
                Assert.Equal(System.Net.HttpStatusCode.BadRequest, res.StatusCode);
            }
        }