Exemple #1
0
        public async void UniversalRepository_Add_model_should_return_valid_model()
        {
            using (Context = new TestDbContext().Context)
            {
                var rep   = new UniversalRepository <Skill>(Context);
                var model = await rep.AddAsync(new Skill()
                {
                    Id = 6
                });

                Assert.Equal(6, model.Id);
            }
        }
Exemple #2
0
        public async void UniversalRepository_Add_null_should_return_argument_null_exception()
        {
            using (Context = new TestDbContext().Context)
            {
                var rep = new UniversalRepository <Skill>(Context);
                var ex  = await Assert.ThrowsAsync <ArgumentNullException>(async() => await rep.AddAsync(null));

                Assert.Equal(typeof(ArgumentNullException), ex.GetType());
            }
        }