public void NotGeneric_UseInvalidDataSourceWithArgs_ThrowsArgumentException() { EngineConfigurationTypeBuilder configuration = new EngineConfigurationTypeBuilder(typeof(SimpleUser)); EngineConfigurationTypeMemberBuilder propertyConfiguration = new EngineConfigurationTypeMemberBuilder(null, configuration); Assert.Throws <ArgumentException>(() => { propertyConfiguration.Use(typeof(SimpleUser), 0, 1, 10); }); }
public void Generic_UseWithArgs_ReturnsTypeBuilder() { EngineConfigurationTypeBuilder <SimpleUser> configuration = new EngineConfigurationTypeBuilder <SimpleUser>(); EngineConfigurationTypeMemberBuilder <SimpleUser, string> propertyConfiguration = new EngineConfigurationTypeMemberBuilder <SimpleUser, string>(null, configuration); IEngineConfigurationTypeBuilder <SimpleUser> returnedConfiguration = propertyConfiguration.Use <SimpleDataSource>(0, 1, 10); Assert.AreEqual(configuration, returnedConfiguration); }
public void NotGeneric_UseWithArgs_ReturnsTypeBuilder() { EngineConfigurationTypeBuilder configuration = new EngineConfigurationTypeBuilder(typeof(SimpleUser)); EngineConfigurationTypeMemberBuilder propertyConfiguration = new EngineConfigurationTypeMemberBuilder(null, configuration); IEngineConfigurationTypeBuilder returnedConfiguration = propertyConfiguration.Use(typeof(SimpleDataSource), 0, 1, 10); Assert.AreEqual(configuration, returnedConfiguration); }
public void NotGeneric_Default_ResetsSource() { EngineConfigurationTypeBuilder configuration = new EngineConfigurationTypeBuilder(typeof(SimpleUser)); EngineConfigurationTypeMemberBuilder propertyConfiguration = new EngineConfigurationTypeMemberBuilder(null, configuration); propertyConfiguration.Use(typeof(SimpleDataSource)); propertyConfiguration.Default(); Assert.AreEqual(0, propertyConfiguration.GetDatasources().Count()); }
public void Generic_Default_ResetsSource() { EngineConfigurationTypeBuilder <SimpleUser> configuration = new EngineConfigurationTypeBuilder <SimpleUser>(); EngineConfigurationTypeMemberBuilder <SimpleUser, string> propertyConfiguration = new EngineConfigurationTypeMemberBuilder <SimpleUser, string>(null, configuration); propertyConfiguration.Use <SimpleDataSource>(); propertyConfiguration.Default(); Assert.AreEqual(0, propertyConfiguration.GetDatasources().Count()); }
public void Generic_GetConfigurationAction_Valid_ReturnsConfigurationAction() { EngineConfigurationTypeBuilder <SimpleUser> configuration = new EngineConfigurationTypeBuilder <SimpleUser>(); EngineTypeMember member = ReflectionHelper.GetMember <SimpleUser>(x => x.EmailAddress); EngineConfigurationTypeMemberBuilder <SimpleUser, string> propertyConfiguration = new EngineConfigurationTypeMemberBuilder <SimpleUser, string>( member, configuration); propertyConfiguration.Use <SimpleDataSource>(); IEngineConfigurationDatasource returnAction = propertyConfiguration.GetDatasources().FirstOrDefault(); Assert.NotNull(returnAction); }