コード例 #1
0
        public void Model_DataContext_Creation()
        {
            // Arrange
            var myDataContext = new CzechLearningContext();

            // Act
            var words = myDataContext.Words;
            var word  = words.First();

            // Assert
            Assert.IsInstanceOfType(myDataContext, typeof(DbContext));
            Assert.IsNotNull(words);
            Assert.IsNotNull(word);
            Assert.IsInstanceOfType(word, typeof(Word));
        }
コード例 #2
0
        /// <summary>
        /// Default constructor.
        /// Populates word from a CzechLearningContext
        /// </summary>
        public QuizController()
        {
            var db = new CzechLearningContext();

            Words = db.Words;
        }