コード例 #1
0
        public void RepositoryTests_Update_Updates()
        {
            var answer = new Answer();

            _repository.Update(answer);
            Assert.Equal(answer.ObjectState, ObjectState.Modified);

            // Check that count stayed the same
            var fake = new FakeAnswers();

            Assert.Equal(_repository.Count(), fake.Count());
        }
コード例 #2
0
        public void RepositoryTests_Insert_Inserts()
        {
            var answer = new Answer();

            _repository.Insert(answer);
            Assert.Equal(answer.ObjectState, ObjectState.Added);

            // Check that one item was added
            var fake = new FakeAnswers();

            Assert.Equal(_repository.Count(), fake.Count() + 1);
        }
コード例 #3
0
        public void RepositoryTests_Count_ReturnsCount()
        {
            var fake = new FakeAnswers();

            Assert.Equal(_repository.Count(), fake.Count());
        }
コード例 #4
0
        public void RepositoryTests_Queryable_ReturnsQueryable()
        {
            var fake = new FakeAnswers();

            Assert.Equal(_repository.Queryable().Count(), fake.Count());
        }
コード例 #5
0
        public void RepositoryTests_Active_ReturnsActive()
        {
            var fake = new FakeAnswers();

            Assert.Equal(_repository.Active().Count(), fake.Count());
        }
コード例 #6
0
        public void RepositoryTests_List_ReturnsDataset()
        {
            var fake = new FakeAnswers();

            Assert.Equal(_repository.List().Count(), fake.Count());
        }