public async Task PostInvalidProfile(string username, string firstname, string lastname) { var profile = new Profile { Username = username, Firstname = firstname, Lastname = lastname }; var e = await Assert.ThrowsAsync <ProfileServiceException>(() => _chatServiceClient.AddProfile(profile)); Assert.Equal(HttpStatusCode.BadRequest, e.StatusCode); }
public async Task PostGetConversationListAssertLimitTest(int paginationLimit) { Profile profile1 = CreateRandomProfile(); await _chatServiceClient.AddProfile(profile1); PostConversationRequest[] conversationsarray = new PostConversationRequest[10]; for (int index = 0; index < 10; index++) { Profile profile2 = CreateRandomProfile(); await _chatServiceClient.AddProfile(profile2); conversationsarray[index] = CreateRandomPostConversationRequest(profile1.Username, profile2.Username); } for (int index = 0; index < 10; index++) { await _chatServiceClient.AddConversation(conversationsarray[index]); } GetConversationsResponse fetchedConversationList = await _chatServiceClient.GetConversationList(profile1.Username, paginationLimit, 0); int countConversationsInFetchedList = fetchedConversationList.Conversations.Length; Assert.Equal(paginationLimit, countConversationsInFetchedList); }
public async Task PostGetProfile() { var profilePictureId = CreateRandomUsername(); var profile = new UserProfile { Username = CreateRandomUsername(), FirstName = "Georges", LastName = "Haddad", ProfilePictureId = profilePictureId }; await _chatServiceClient.AddProfile(profile); _profilesToCleanup.Add(profile); var fetchedProfile = await _chatServiceClient.GetProfile(profile.Username); Assert.Equal(profile, fetchedProfile); }