public void Cache_User() { var apiObject = new InternalVkApiObject() { Id = 123, Type = InternalVkObjectType.User }; A.CallTo(() => vkClient.GetUsers(A <InternalVkApiUserGetRequestParams> .Ignored)) .Returns(new[] { A.Dummy <InternalVkApiUser>() }); usernameProvider.GetUsernameForObject(apiObject); usernameProvider.GetUsernameForObject(apiObject); A.CallTo(() => vkClient.GetUsers(A <InternalVkApiUserGetRequestParams> .Ignored)) .MustHaveHappenedOnceExactly(); }
public static InternalVkApiUser GetUserOrDie(this IVkClient client, long id) { return(client.GetUsers(new InternalVkApiUserGetRequestParams { Ids = new[] { id } }).Single()); }