Exemplo n.º 1
0
        public async Task Schedule_ReturnsSuccessStatusCode()
        {
            var jobUnit = _jobMaker.CreateJobDto();
            var content = Utilities.GetRequestContent(jobUnit);

            var response = await _client.PostAsync("api/Job/Schedule", content);

            response.EnsureSuccessStatusCode();

            var vm = await Utilities.GetResponseContent <Result>(response);

            Assert.True(vm.Success);
        }
        public async Task Unschedule_ReturnsSuccessStatusCode()
        {
            var jobUnit = _jobMaker.CreateJobDto(Guid.NewGuid().ToString());
            var content = Utilities.GetRequestContent(jobUnit);

            await _client.PostAsync("api/Job/Schedule", content);

            var response = await _client.DeleteAsync($"api/Job/Unschedule/{jobUnit.Key}");

            response.EnsureSuccessStatusCode();

            var vm = await Utilities.GetResponseContent <Result>(response);

            Assert.True(vm.Success);
        }