public void CosmosUniqueKeyPolicyProviderCorrectlyGetsNullWhenNoAttributesAreApplied()
        {
            ICosmosUniqueKeyPolicyProvider provider = new DefaultCosmosUniqueKeyPolicyProvider();
            UniqueKeyPolicy?policy = provider.GetUniqueKeyPolicy <SomeInterestingClass4>();

            Assert.Null(policy);
        }
        public void CosmosUniqueKeyPolicyProviderCorrectlyGetsOneUniqueKeyAndPropertyPath()
        {
            ICosmosUniqueKeyPolicyProvider provider = new DefaultCosmosUniqueKeyPolicyProvider();

            UniqueKeyPolicy?policy = provider.GetUniqueKeyPolicy <SomeInterestingClass5>();

            Assert.Equal("/name", policy !.UniqueKeys.Single().Paths.Single());
        }
        public void CosmosUniqueKeyPolicyProviderCorrectlyGetsUniqueKeysWithTwoPaths()
        {
            ICosmosUniqueKeyPolicyProvider provider = new DefaultCosmosUniqueKeyPolicyProvider();

            UniqueKeyPolicy?policy = provider.GetUniqueKeyPolicy <SomeInterestingClass2>();

            Assert.Contains("/Street", policy !.UniqueKeys.Single().Paths);
            Assert.Contains("/HouseNumber", policy.UniqueKeys.Single().Paths);
            Assert.Equal(2, policy.UniqueKeys.Single().Paths.Count);
        }
        public void CosmosUniqueKeyPolicyProviderCorrectlyGetsTwoUniqueKeys()
        {
            ICosmosUniqueKeyPolicyProvider provider = new DefaultCosmosUniqueKeyPolicyProvider();

            UniqueKeyPolicy?policy = provider.GetUniqueKeyPolicy <SomeInterestingClass3>();
            UniqueKey       key1   = policy !.UniqueKeys.Single(key => key.Paths.Count == 2);
            UniqueKey       key2   = policy.UniqueKeys.Single(key => key.Paths.Count == 1);

            Assert.Contains("/Street", key1.Paths);
            Assert.Contains("/HouseNumber", key1.Paths);
            Assert.Equal(2, key1.Paths.Count);

            Assert.Contains("/Name", key2.Paths);
            Assert.Single(key2.Paths);
        }