public void GetAllProfilesReturnTwoTestUsers() { using (var profileService = new ProfileService.ProfileServiceClient()) { var profile = profileService.GetOrCreateProfile( userName: testBase.TestProfileOne.UserName, regionId: (int)testBase.TestProfileOne.Region, platformId: (int)testBase.TestProfileOne.Region); testBase.TestProfileOne.ProfileGuid = profile.ProfileGuid; profile = profileService.GetOrCreateProfile( userName: testBase.TestProfileTwo.UserName, regionId: (int)testBase.TestProfileTwo.Region, platformId: (int)testBase.TestProfileTwo.Region); testBase.TestProfileTwo.ProfileGuid = profile.ProfileGuid; } var profList = new List <Profile>(); using (var profileService = new ProfileService.ProfileServiceClient()) { profList = profileService.RetieveAllProfiles().ToList(); } var testProfileOneExists = profList.Any(p => p.ProfileGuid == testBase.TestProfileOne.ProfileGuid); var testProfileTwoExists = profList.Any(p => p.ProfileGuid == testBase.TestProfileTwo.ProfileGuid); Assert.IsTrue(testProfileOneExists, "Test Profile One was not returned"); Assert.IsTrue(testProfileTwoExists, "Test Profile Two was not returned"); }
public void CleanUpProfileScriptShouldDeleteTestUserOne() { using (var profileService = new ProfileService.ProfileServiceClient()) { var profile = profileService.GetOrCreateProfile( userName: testBase.TestProfileOne.UserName, regionId: (int)testBase.TestProfileOne.Region, platformId: (int)testBase.TestProfileOne.Region); testBase.TestProfileOne.ProfileGuid = profile.ProfileGuid; } using (var cleanUpService = new CleanUpService.CleanUpServiceClient()) { cleanUpService.DeleteUser(testBase.TestProfileOne.ProfileGuid); } using (var profileService = new ProfileService.ProfileServiceClient()) { var profile = profileService.RetrieveProfile( userName: testBase.TestProfileOne.UserName, regionId: (int)testBase.TestProfileOne.Region, platformId: (int)testBase.TestProfileOne.Region); testBase.TestProfileOne.ProfileGuid = (profile == null) ? profile.ProfileGuid : Guid.Empty; } }
internal void AddProfiles() { using (var profileService = new ProfileService.ProfileServiceClient()) { profilebase.TestProfileOne.ProfileGuid = profileService .GetOrCreateProfile( userName: profilebase.TestProfileOne.UserName, platformId: (int)profilebase.TestProfileOne.Platform, regionId: (int)profilebase.TestProfileOne.Region).ProfileGuid; profilebase.TestProfileTwo.ProfileGuid = profileService .GetOrCreateProfile( userName: profilebase.TestProfileTwo.UserName, platformId: (int)profilebase.TestProfileTwo.Platform, regionId: (int)profilebase.TestProfileTwo.Region).ProfileGuid; } }
public void GetOrCreateProfileShouldReturnNewProfile() { using (var profileService = new ProfileService.ProfileServiceClient()) { var profile = profileService.GetOrCreateProfile( userName: testBase.TestProfileOne.UserName, regionId: (int)testBase.TestProfileOne.Region, platformId: (int)testBase.TestProfileOne.Region); testBase.TestProfileOne.ProfileGuid = profile.ProfileGuid; } Assert.AreNotEqual(notExpected: Guid.Empty, actual: testBase.TestProfileOne.ProfileGuid); }