Esempio n. 1
0
        public async Task DeleteAsync_Test()
        {
            //Arrange
            var feedIterator = CreateFeedIteratorWithResponse(Enumerable.Empty <string>());

            Container.GetItemQueryIterator <string>(Arg.Any <QueryDefinition>(), requestOptions: Arg.Any <QueryRequestOptions>())
            .ReturnsForAnyArgs(feedIterator);

            //Act
            var result = await _sut.DeleteAsync(ApplicationId, _id).ConfigureAwait(false);

            //Assert
            result.Should().NotBeNull();
            result.Should().BeOfType <OkResult>();

            Container.Received(1)
            .GetItemQueryIterator <string>(Arg.Any <QueryDefinition>(), requestOptions: Arg.Any <QueryRequestOptions>());

            await Container.Received(1)
            .DeleteItemAsync <Group>(Arg.Is(_id), Arg.Any <PartitionKey>())
            .ConfigureAwait(false);
        }