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); }
public void Generic_Use_ReturnsTypeBuilder() { EngineConfigurationTypeBuilder<SimpleUser> configuration = new EngineConfigurationTypeBuilder<SimpleUser>(); EngineConfigurationTypeMemberBuilder<SimpleUser, string> propertyConfiguration = new EngineConfigurationTypeMemberBuilder<SimpleUser, string>(null, configuration); IEngineConfigurationTypeBuilder<SimpleUser> returnedConfiguration = propertyConfiguration.Use<SimpleDataSource>(); Assert.AreEqual(configuration, returnedConfiguration); }
public void NotGeneric_Use_ReturnsTypeBuilder() { EngineConfigurationTypeBuilder configuration = new EngineConfigurationTypeBuilder(typeof(SimpleUser)); EngineConfigurationTypeMemberBuilder propertyConfiguration = new EngineConfigurationTypeMemberBuilder(null, configuration); IEngineConfigurationTypeBuilder returnedConfiguration = propertyConfiguration.Use(typeof(SimpleDataSource)); Assert.AreEqual(configuration, returnedConfiguration); }
public void NotGeneric_UseInvalidDataSource_ThrowsArgumentException() { EngineConfigurationTypeBuilder configuration = new EngineConfigurationTypeBuilder(typeof(SimpleUser)); EngineConfigurationTypeMemberBuilder propertyConfiguration = new EngineConfigurationTypeMemberBuilder(null, configuration); Assert.Throws<ArgumentException>(() => { propertyConfiguration.Use(typeof(SimpleUser)); }); }
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()); }