public void Save_ValidatorForEntityNotSpecified_ShouldProceedDirectlyToDbOperation()
        {
            //Arrange
            var characteristic = new NumericCharacteristic("some name", ComponentType.PowerSupply);

            //Act
            _context.Characteristics.Add(characteristic);
            _context.SaveChanges();

            Assert.That(_context.Characteristics.ToList().Count == 1);
        }
示例#2
0
        private static void Main(string[] args)
        {
            Console.WriteLine("Initializing DB structure...");
            using (var context = new PCExpertContext("dbToFill",
                                                     new DropCreateDatabaseAlways <PCExpertContext>(),
                                                     new DomainValidatorFactory()))
            {
                Console.WriteLine("DB structure initialized");
                Console.WriteLine("Generating test data");

                var workplace   = new EfWorkplace(new TestDbContextProvider(context));
                var dataCreator = new TestDataGenerator();
                dataCreator.CreateRandomData(workplace);

                context.SaveChanges();

                Console.WriteLine("Test data generated");
            }
        }