Esempio n. 1
0
        public async void GetCardAsync_CardExist_GotCardModel()
        {
            var optionsBuilder = new DbContextOptionsBuilder <WeightWatchersContext>()
                                 .UseSqlServer("Server = C1; Database = WeightWatchersDB ;Trusted_Connection=True; ").Options;
            WeightWatchersContext weightWatchersContext = new WeightWatchersContext(optionsBuilder);


            var subscriberService = new SubscriberService(new SubscriberRepository(weightWatchersContext, mapper), mapper);

            //Act - Call the method being tested
            var card = await subscriberService.GetCardAsync(1);

            //Assert
            Assert.IsType <CardModel>(card);
        }