예제 #1
0
        public void TestGetAllMakers()
        {
            // arrange
            var repo = new MakerRepository(_context, _mapper);

            // act
            var result = repo.GetAll();

            // assert
            Assert.Equal(MockData.ListOfMakers.Count(), result.Count());
        }
예제 #2
0
        public async void TestUpdateMaker()
        {
            // arrange
            int   indexMaker = 5;
            var   repo       = new MakerRepository(_context, _mapper);
            Maker Expected   = MockData.ListOfMakers.Where(m => m.Id == indexMaker).FirstOrDefault();

            // act
            var result = await repo.Update(Expected);

            // assert
            Assert.Equal(Expected, result);
        }