Esempio n. 1
0
        public void NumberContextShouldHaveSomeSeedData_WhenIntialized()
        {
            // Arrange
            using (var context = new NumberContext(SqlLiteMemoryContextOptions()))
            {
                context.Database.EnsureCreated();

                // Act
                context.Initialize();
                var result = context.Numbers;

                // Assert
                result.Should().HaveCountGreaterThan(1);
            }
        }
Esempio n. 2
0
        public void NumberContextShouldHaveAllSeedData_WhenIntialized()
        {
            // Arrange
            using (var context = new NumberContext(SqlLiteMemoryContextOptions()))
            {
                context.Database.EnsureCreated();

                // Act
                context.Initialize();
                var result = context.Numbers;

                // Assert
                // Update the test if the seed data is ever updated
                // If this is a regular occurance or you plan to allow seed data to be configurable
                // Update this test and the context to accept it in another way
                result.Should().HaveCount(100);
            }
        }