Exemplo n.º 1
0
        public async Task UpdateAsync()
        {
            var apiConnection = Substitute.For <IApiConnection>();
            var client        = new ListingClient(apiConnection);

            await client.UpdateAsync(1, new UpdateListing());

            await apiConnection.Received().ExecutePutAsync <object, Listing>("listings/1", Arg.Any <object>());
        }
Exemplo n.º 2
0
        public async Task UpdateAsync_UpdateListingNull_Throw()
        {
            var apiConnection = Substitute.For <IApiConnection>();
            var client        = new ListingClient(apiConnection);

            await Assert.ThrowsExceptionAsync <ArgumentNullException>(async() => await client.UpdateAsync(1, null));

            await apiConnection.DidNotReceive().ExecutePutAsync <object, Listing>(Arg.Any <string>(), Arg.Any <object>());
        }