コード例 #1
0
		public void Type_name_should_be_unique_key()
		{
			// arrange
			var injection = new TestEntityValidationInjection();
			
			// act + assert
			Assert.That(injection.UniqueKey, Is.EqualTo("TestEntityValidationInjection"));
		}
コード例 #2
0
		public void EntityValidation_should_be_injectable()
		{
			// arrange
			var injection = new TestEntityValidationInjection();
			var injectionSet = new InjectionSet(injection, new TestModelCreationInjection());
			var factory = new DbContextFactory();

			// act
			using (var context = Create(factory, injectionSet))
			{
				context.ActionTypes.Add(new ActionType());
				
				context.GetValidationErrors();
			}

			// assert
			Assert.That(injection.Entries.Count, Is.EqualTo(1));
		}