Ejemplo n.º 1
0
        public async Task CreatePerson_UnavailableError_ShouldReturnAnUnavailableCode()
        {
            var expected = Status.Unavailable;

            var personApi = ApiFactory.CreatePersonApiService();

            personApi.CreatePerson(Arg.Any <CreatePersonRequestDto>()).Returns(Task.FromResult(HttpResponseFactory.CreateNotAvailableMessage(null)));
            var personService = new PersonService(personApi);

            var actual = await personService.CreatePerson("Lorem", "Ipsum", "123 Nowhere St", "509-555-1234", "99206", "WA", 23, new DateTime(1980, 01, 01));

            Assert.AreEqual(expected, actual.StatusCode);
        }