public void DomainEntity_AssocatedWithBehavior() { var resolver = new MockResolver(); var factory = new DomainEntityFactory(resolver); factory.AddBehavior <IMockDomainBehavior, MockGlobalDomainBehavior>(); var domainEntity = factory.Create <MockDomainEntity>(); var behavior = domainEntity.Entity.GetBehavior <IMockDomainBehavior>(); domainEntity.Should().BeSameAs(behavior.instance.DomainEntity); }
public void BehaviorServices_AreResolved() { var resolver = new MockResolver(); var factory = new DomainEntityFactory(resolver); factory.AddBehavior <IMockDomainBehavior, MockGlobalDomainBehavior>(); resolver.ResolveCount.Should().Be(0); var domainEntity = factory.Create <MockDomainEntity>(); var behavior = domainEntity.Entity.GetBehavior <IMockDomainBehavior>(); resolver.ResolveCount.Should().Be(1); }