Пример #1
0
        public async Task CanSetRepositoryProperties()
        {
            // Arrange
            ContainerRepositoryClient client = CreateClient();
            RepositoryProperties      repositoryProperties = await client.GetPropertiesAsync();

            ContentProperties originalContentProperties = repositoryProperties.WriteableProperties;

            // Act
            await client.SetPropertiesAsync(
                new ContentProperties()
            {
                CanList   = false,
                CanRead   = false,
                CanWrite  = false,
                CanDelete = false,
            });

            // Assert
            RepositoryProperties properties = await client.GetPropertiesAsync();

            Assert.IsFalse(properties.WriteableProperties.CanList);
            Assert.IsFalse(properties.WriteableProperties.CanRead);
            Assert.IsFalse(properties.WriteableProperties.CanWrite);
            Assert.IsFalse(properties.WriteableProperties.CanDelete);

            // Cleanup
            await client.SetPropertiesAsync(originalContentProperties);
        }
        public async Task InitializeRepositoryProperties()
        {
            await _client.SetPropertiesAsync(
                new ContentProperties()
            {
                CanList   = true,
                CanRead   = true,
                CanWrite  = true,
                CanDelete = true
            });

            RepositoryProperties properties = await _client.GetPropertiesAsync();

            Assert.IsTrue(properties.WriteableProperties.CanList);
            Assert.IsTrue(properties.WriteableProperties.CanRead);
            Assert.IsTrue(properties.WriteableProperties.CanWrite);
            Assert.IsTrue(properties.WriteableProperties.CanDelete);
        }
Пример #3
0
        public async Task CanSetRepositoryProperties([Values(true, false)] bool canList,
                                                     [Values(true, false)] bool canRead,
                                                     [Values(true, false)] bool canWrite,
                                                     [Values(true, false)] bool canDelete)
        {
            await _client.SetPropertiesAsync(
                new ContentProperties()
            {
                CanList   = canList,
                CanRead   = canRead,
                CanWrite  = canWrite,
                CanDelete = canDelete
            });

            RepositoryProperties properties = await _client.GetPropertiesAsync();

            Assert.AreEqual(canList, properties.ModifiableProperties.CanList);
            Assert.AreEqual(canRead, properties.ModifiableProperties.CanRead);
            Assert.AreEqual(canWrite, properties.ModifiableProperties.CanWrite);
            Assert.AreEqual(canDelete, properties.ModifiableProperties.CanDelete);
        }