public void TryGetWithEmptyAttribute() { LocationFilter location; bool result = AmplaLocationAttribute.TryGetLocation <ModelWithEmptyLocation>(out location); Assert.That(location, Is.EqualTo(null)); Assert.That(result, Is.False); }
public void TryGetWithConstructorLocationWithOverriddenRecurseProperty() { LocationFilter location; bool result = AmplaLocationAttribute.TryGetLocation <ModelLocationWithRecurseViaConstructorOverrideProperty>(out location); Assert.That(location.Filter, Is.EqualTo("Enterprise.Site")); Assert.That(result, Is.True); Assert.That(location.Location, Is.EqualTo("Enterprise.Site")); Assert.That(location.WithRecurse, Is.EqualTo(false)); }
public void TryGetWithConstructorLocationWithRecurse() { LocationFilter location; bool result = AmplaLocationAttribute.TryGetLocation <ModelLocationWithRecurseViaConstructor>(out location); Assert.That(location.Filter, Is.EqualTo("Enterprise.Site with recurse")); Assert.That(result, Is.True); Assert.That(location.Location, Is.EqualTo("Enterprise.Site")); Assert.That(location.WithRecurse, Is.EqualTo(true)); }
public void TryGetModelWithOverriddenLocation() { LocationFilter location; bool result = AmplaLocationAttribute.TryGetLocation <ModelWithOverriddenLocation>(out location); Assert.That(location.Filter, Is.EqualTo("Enterprise.Site.Area.Overridden")); Assert.That(location.Location, Is.EqualTo("Enterprise.Site.Area.Overridden")); Assert.That(location.WithRecurse, Is.EqualTo(false)); Assert.That(result, Is.True); }
public void TryGetInheritedWithLocation() { LocationFilter location; bool result = AmplaLocationAttribute.TryGetLocation <InheritedModelWithLocation>(out location); Assert.That(location.Filter, Is.EqualTo("Enterprise.Site.Area.Point")); Assert.That(location.Location, Is.EqualTo("Enterprise.Site.Area.Point")); Assert.That(location.WithRecurse, Is.EqualTo(false)); Assert.That(result, Is.True); }