示例#1
0
        public async Task GetAsync()
        {
            var apiConnection = Substitute.For <IApiConnection>();
            var client        = new ProfileImageClient(apiConnection);

            await client.GetAsync("test");

            await apiConnection.Received().ExecuteGetAsync <ProfileImage>("profile_images/test");
        }
示例#2
0
        public async Task GetAsync_UsernameEmpty_Throw()
        {
            var apiConnection = Substitute.For <IApiConnection>();
            var client        = new ProfileImageClient(apiConnection);

            await Assert.ThrowsExceptionAsync <ArgumentNullException>(async() => await client.GetAsync(string.Empty));

            await apiConnection.DidNotReceive().ExecuteGetAsync <ProfileImage>(Arg.Any <string>());
        }