public void Apply_IntId_NoIdGenerator() { var target = new StringIdStoredAsObjectIdConvention(); var subject = SampleMap <TestClassWithIntId>(); target.Apply(subject); Assert.Null(subject.IdGenerator); }
public void Apply_IntId_LeavesSerializer() { var target = new StringIdStoredAsObjectIdConvention(); var subject = SampleMap <TestClassWithIntId>(); target.Apply(subject); Assert.IsNotType <StringSerializer>(subject.GetSerializer()); }
public void Apply_StringId_SetsIdGenerator() { var target = new StringIdStoredAsObjectIdConvention(); var subject = SampleMap <TestClassWithStringId>(); target.Apply(subject); Assert.IsType <StringObjectIdGenerator>(subject.IdGenerator); }
public void Apply_NotStringSerializer_DoesNotApply() { var target = new StringIdStoredAsObjectIdConvention(); var subject = SampleMap <TestClassWithStringId>(); subject.SetSerializer(new FakeStringSerializer()); target.Apply(subject); Assert.IsType <FakeStringSerializer>(subject.GetSerializer()); }
public void Apply_ExistingIdGenerator_DoesNotApply() { var target = new StringIdStoredAsObjectIdConvention(); var subject = SampleMap <TestClassWithStringId>(); subject.SetIdGenerator(CombGuidGenerator.Instance); target.Apply(subject); Assert.IsType <CombGuidGenerator>(subject.IdGenerator); }