public void Should_return_result_with_error()
            {
                // Arrange
                var nationalities = new List <Nationality>
                {
                    new Nationality
                    {
                        Name = "English",
                    },
                    new Nationality
                    {
                        Name = "Irish"
                    }
                };
                var result = new Result <IList <Nationality> >();

                result.AddError("there was an error");
                NationalityServiceMock
                .Setup(x => x.ListAllNationalitiesAsync())
                .ReturnsAsync(result);

                // Act
                var requestResult = ControllerUnderTest.ListAllNationalities();

                // Assert
                var okResult = Assert.IsType <OkObjectResult>(requestResult.Result);

                Assert.Same(result, okResult.Value);
            }
            public async void Should_return_OK()
            {
                // Arrange
                var nationality = new Nationality
                {
                    Name = "England"
                };
                var result = new Result();

                NationalityServiceMock
                .Setup(x => x.AddNationalityAsync(nationality))
                .ReturnsAsync(result);

                // Act
                var requestResult = await ControllerUnderTest.AddNationality(nationality);

                // Assert
                var okResult = Assert.IsType <OkObjectResult>(requestResult);

                Assert.Same(result, okResult.Value);
            }
            public async void Should_return_error_with_message()
            {
                // Arrange
                var nationality = new Nationality
                {
                    Name = "Australia"
                };
                var result = new Result();

                result.AddError("there was an error");
                NationalityServiceMock
                .Setup(x => x.UpdateNationalityAsync(nationality))
                .ReturnsAsync(result);

                // Act
                var requestResult = await ControllerUnderTest.UpdateNationality(nationality);

                // Assert
                var okResult = Assert.IsType <OkObjectResult>(requestResult);

                Assert.Same(result, okResult.Value);
            }