Пример #1
0
        public async Task GetBankAccountById_Test()
        {
            var _efCoreMock = new Mock <IRepository>();

            _efCoreMock.Setup(x => x.GetById <BankAccount>(It.IsAny <int>()));
            var userStore = new Mock <IUserStore <Customer> >();

            var _customerManagerMock = new Mock <UserManager <Customer> >(
                userStore.Object, null, null, null, null, null, null, null, null);

            var _mapperMock    = new Mock <IMapper>();
            var bankController = new BankAccountController(_efCoreMock.Object,
                                                           _customerManagerMock.Object,
                                                           _mapperMock.Object);

            var response = await bankController.GetAccountById(1008);

            var ok = response as CreatedAtRouteNegotiatedContentResult <BankAccount>;

            Assert.NotNull(ok);
        }