Exemplo n.º 1
0
        public void DeleteAccountThrowsExceptionWithInvalidParametersTest(string provider, string subject)
        {
            var sut = new AccountStore(Config.Storage);

            Func <Task> action = async() => await sut.DeleteAccount(provider, subject, CancellationToken.None)
                                 .ConfigureAwait(false);

            action.Should().Throw <ArgumentException>();
        }
Exemplo n.º 2
0
        public async Task DeleteAccountIgnoresWhenAccountNotFoundTest()
        {
            var provider = Guid.NewGuid().ToString();
            var subject  = Guid.NewGuid().ToString();

            var sut = new AccountStore(Config.Storage);

            await sut.DeleteAccount(provider, subject, CancellationToken.None).ConfigureAwait(false);
        }
Exemplo n.º 3
0
        public async Task DeleteAccountRemovesAccountTest()
        {
            var provider = Guid.NewGuid().ToString();
            var subject  = Guid.NewGuid().ToString();

            var sut = new AccountStore(Config.Storage);

            await sut.GetAccount(provider, subject, CancellationToken.None).ConfigureAwait(false);

            await sut.DeleteAccount(provider, subject, CancellationToken.None).ConfigureAwait(false);

            // Retrieve storage account from connection-string
            var storageAccount = CloudStorageAccount.Parse(Config.Storage.ConnectionString);

            // Create the client
            var client    = storageAccount.CreateCloudTableClient();
            var operation = TableOperation.Retrieve(provider, subject);

            var table = client.GetTableReference("Accounts");

            var result = await table.ExecuteAsync(operation).ConfigureAwait(false);

            result.HttpStatusCode.Should().Be(404);
        }