public void WhenGettingPartitionKeyWithoutAnnotatedProperty_ThenThrows() => Assert.Throws <ArgumentException>(() => PartitionKeyAttribute.CreateAccessor <EntityWithoutAttributes>());
public void WhenGettingPartitionKey_ThenReturnsValue() => Assert.Equal("123", PartitionKeyAttribute.CreateAccessor <EntityWithAttributes>().Invoke(new EntityWithAttributes { PartitionKey = "123" }));
public void WhenGettingPartitionKeyWithInvalidChar_ThenThrows() => Assert.Throws <ArgumentException>(() => PartitionKeyAttribute.CreateAccessor <EntityWithAttributes>().Invoke(new EntityWithAttributes { PartitionKey = " \\ " }));
public void WhenGettingPartitionKeyWhitespacePropertyValue_ThenThrows() => Assert.Throws <ArgumentException>(() => PartitionKeyAttribute.CreateAccessor <EntityWithAttributes>().Invoke(new EntityWithAttributes { PartitionKey = " " }));
public void WhenGettingPartitionKeyNullPropertyValue_ThenThrows() => Assert.Throws <ArgumentNullException>(() => PartitionKeyAttribute.CreateAccessor <EntityWithAttributes>().Invoke(new EntityWithAttributes()));
public void WhenGettingNonStringPartitionKey_ThenThrows() => Assert.Throws <ArgumentException>(() => PartitionKeyAttribute.CreateAccessor <EntityWithAttributesWrongTypes>());