public void IdShouldDefaultToZero() { var builder = new ContentItemBuilder(new ContentTypeDefinitionBuilder().Named("foo").Build()); var model = builder.Build(); Assert.That(model.Id, Is.EqualTo(0)); }
public void BuilderShouldReturnWorkingModelWithTypeAndId() { var builder = new ContentItemBuilder(new ContentTypeDefinitionBuilder().Named("foo").Build()); var model = builder.Build(); Assert.That(model.ContentType, Is.EqualTo("foo")); }
public void WeldShouldAddPartToModel() { var builder = new ContentItemBuilder(new ContentTypeDefinitionBuilder().Named("foo").Build()); builder.Weld<AlphaPart>(); var model = builder.Build(); Assert.That(model.Is<AlphaPart>(), Is.True); Assert.That(model.As<AlphaPart>(), Is.Not.Null); Assert.That(model.Is<BetaPart>(), Is.False); Assert.That(model.As<BetaPart>(), Is.Null); }
public void WeldShouldAddPartToModel() { var builder = new ContentItemBuilder("foo"); builder.Weld<Alpha>(); var model = builder.Build(); Assert.That(model.Is<Alpha>(), Is.True); Assert.That(model.As<Alpha>(), Is.Not.Null); Assert.That(model.Is<Beta>(), Is.False); Assert.That(model.As<Beta>(), Is.Null); }
public void WeldShouldAddPartToModel() { var builder = new ContentItemBuilder(new ContentTypeDefinitionBuilder().Named("foo").Build()); builder.Weld <AlphaPart>(); var model = builder.Build(); Assert.That(model.Is <AlphaPart>(), Is.True); Assert.That(model.As <AlphaPart>(), Is.Not.Null); Assert.That(model.Is <BetaPart>(), Is.False); Assert.That(model.As <BetaPart>(), Is.Null); }
public void PartShouldBeAddedBasedOnSimplePredicate() { var modelDriver = new TestModelHandler(); var builder = new ContentItemBuilder(new ContentTypeDefinitionBuilder().Named("testing").Build()); ((IContentHandler)modelDriver).Activating(new ActivatingContentContext { Builder = builder, ContentType = "testing" }); var model = builder.Build(); Assert.That(model.Is <TestModelPart>(), Is.True); Assert.That(model.As <TestModelPart>(), Is.Not.Null); }
public void IdShouldDefaultToZero() { var builder = new ContentItemBuilder(new ContentTypeDefinitionBuilder().Named("foo").Build()); var model = builder.Build(); Assert.That(model.Id, Is.EqualTo(0)); }
public void BuilderShouldReturnWorkingModelWithTypeAndId() { var builder = new ContentItemBuilder(new ContentTypeDefinitionBuilder().Named("foo").Build()); var model = builder.Build(); Assert.That(model.ContentType, Is.EqualTo("foo")); }
public void IdShouldDefaultToZero() { var builder = new ContentItemBuilder("foo"); var model = builder.Build(); Assert.That(model.Id, Is.EqualTo(0)); }