public void TestGetNull()
        {
            //Arrange
            Mock <IAccountDetailsApplicationService> mockAccountDetailsApplicationService =
                new Mock <IAccountDetailsApplicationService>();

            mockAccountDetailsApplicationService.Setup(service => service.GetAccountDetails())
            .Throws <InvalidOperationException>();
            AccountDetailsController controller = new AccountDetailsController(mockAccountDetailsApplicationService.Object);
            //Act
            IActionResult actionResult = controller.Get();

            //Assert
            Assert.IsType <NoContentResult>(actionResult);
        }
        /// <summary>
        /// Setup dependancies for controller, application service, repository.
        /// </summary>
        public AccountDetailsTest()
        {
            DbContextOptions <BookShopDatabaseontext> options =
                new DbContextOptionsBuilder <BookShopDatabaseontext>()
                .UseInMemoryDatabase(databaseName: "TestDB")
                .Options;

            BookShopDatabaseontext dbContext =
                new BookShopDatabaseontext(options);

            AccountDetailsRepository accountDetailsRepository = new AccountDetailsRepository(dbContext);

            AccountDetailsApplicationService accountDetailsApplicationService =
                new AccountDetailsApplicationService(accountDetailsRepository);

            accountDetailsController = new AccountDetailsController(accountDetailsApplicationService);
        }
        public void TestGet()
        {
            //Arrange

            Mock <IAccountDetailsApplicationService> mockAccountDetailsApplicationService =
                new Mock <IAccountDetailsApplicationService>();

            mockAccountDetailsApplicationService.Setup(service => service.GetAccountDetails())
            .Returns(new List <AccountDetailsDto>()
            {
                new AccountDetailsDto(), new AccountDetailsDto()
            });

            AccountDetailsController controller = new AccountDetailsController(mockAccountDetailsApplicationService.Object);
            //Act
            IActionResult actionResult = controller.Get();

            //Assert
            Assert.IsType <OkObjectResult>(actionResult);
        }