Beispiel #1
0
        public MockStudentQuizResultRepository()
        {
            _context = new List <StudentQuizResult>();

            for (int i = 1; i <= 2; i++)
            {
                var result = GetFakeQuiz.StudentResult(i);
                _context.Add(result);
            }
        }
Beispiel #2
0
        public void Create()
        {
            // Arrange
            var id   = 888;
            var item = GetFakeQuiz.StudentResult(id);

            // Act
            var result = repository.CreateItem(item);

            // Assert
            Assert.IsTrue(result);
            var insertedItem = repository.GetItem(id);

            Assert.IsTrue(insertedItem.Id == id);
            var items = repository.GetAllItems();

            Assert.IsTrue(items.Count() == ITEMS_COUNT + 1);
        }