public void Appliability_is_tested() { var contributor = new MockContributor(true); ActiveRecordStarter.AddContributor(contributor); ActiveRecordStarter.Initialize(GetConfigSource(), typeof(Post), typeof(Blog)); Assert.IsTrue(contributor.Tested); }
public void Contributor_gets_called() { var contributor = new MockContributor(true); ActiveRecordStarter.AddContributor(contributor); ActiveRecordStarter.Initialize(GetConfigSource(), typeof(Post), typeof(Blog)); Assert.IsTrue(contributor.Called); }
public void Contributor_that_doesnt_apply_is_not_called() { var contributor = new MockContributor(false); ActiveRecordStarter.AddContributor(contributor); ActiveRecordStarter.Initialize(GetConfigSource(), typeof(Post), typeof(Blog)); Assert.IsTrue(contributor.Tested); Assert.IsFalse(contributor.Called); }
public override ActiveRecord.Config.IActiveRecordConfiguration GetConfigSource() { var contributor = new MockContributor(); return base.GetConfigSource() .GetConfiguration(string.Empty) .AddContributor(contributor) .Source; }
public override ActiveRecord.Config.IActiveRecordConfiguration GetConfigSource() { var contributor = new MockContributor(); return(base.GetConfigSource() .GetConfiguration(string.Empty) .AddContributor(contributor) .Source); }