public void GetIdFrom_CalledWhenPropertyIsInternal_ExpectValueOfPropertyIsReturned()
 {
     var id = StringGenerator.AnyNonNull();
     var aggregateRoot = new AggregateRootWithInternalId(id);
     var getter = new TypedPropertyAggregateRootIdGetter<AggregateRootWithInternalId, string>();
     getter.GetIdFrom(aggregateRoot).Should().BeSameAs(id);
 }
 public void GetIdFrom_CalledWhenPropertyIsShadowedAndAggregateRootIsBase_ExpectValueOfBasePropertyIsReturned()
 {
     var baseId = StringGenerator.AnyNonNull();
     var aggregateRoot = new AggregateRootWithShadowedId(baseId, StringGenerator.AnyNonNull());
     var getter = new TypedPropertyAggregateRootIdGetter<AggregateRootWithShadowedIdBase, string>();
     getter.GetIdFrom(aggregateRoot).Should().BeSameAs(baseId);
 }
 public void GetIdFrom_CalledWhenPropertyIsPublic_ExpectValueOfPropertyIsReturned()
 {
     var aggregateRoot = new AggregateRoot { StringProperty = StringGenerator.AnyNonNull() };
     var getter = new TypedPropertyAggregateRootIdGetter<AggregateRoot, string>();
     getter.GetIdFrom(aggregateRoot).Should().BeSameAs(aggregateRoot.StringProperty);
 }