public void MatchMethodTest() { var testGenerator = new TestGenerator(); var invoker = new DynamicInvoker( testGenerator ); var typeProperty = new TypeProperty { Name = "TypeProperty1", Type = typeof(int) }; var navigationProperty1 = new NavigationProperty { Name = "Property1", Property = typeProperty, IsCollection = true }; var navigationProperty2 = new NavigationProperty { Name = "Property2", Property = typeProperty, IsCollection = false }; invoker.Invoke<object>( "DefineProperty", navigationProperty1 ); invoker.Invoke<object>( "DefineProperty", navigationProperty2 ); Assert.That( testGenerator.TypeDefinePropertyCalls, Is.EqualTo( 0 ) ); Assert.That( testGenerator.NavigationDefinePropertyCalls, Is.EqualTo( 2 ) ); Assert.That( testGenerator.NavigationListDefinePropertyCalls, Is.EqualTo( 1 ) ); Assert.That( testGenerator.NavigationNotListDefinePropertyCalls, Is.EqualTo( 1 ) ); }
private bool MatchDefinePropertyIsNotList( NavigationProperty navigationProperty ) { return !navigationProperty.IsCollection; }
public void DefinePropertyIsNotList( NavigationProperty navigationProperty ) { this.NavigationDefinePropertyCalls++; this.NavigationNotListDefinePropertyCalls++; }