public async Task Cannot_Set_ContactPerson(OrganizationRole role) { //Arrange var login = await HttpApi.GetCookieAsync(role); const int organizationId = TestEnvironment.DefaultOrganizationId; var contactPersonDto = await OrganizationHelper.GetContactPersonAsync(organizationId); var name = A <string>(); var lastName = A <string>(); var email = A <string>(); var phone = A <string>(); //Act - perform the action with the actual role using (var result = await OrganizationHelper.SendChangeContactPersonRequestAsync(contactPersonDto.Id, organizationId, name, lastName, email, phone, login)) { //Assert Assert.Equal(HttpStatusCode.Forbidden, result.StatusCode); } }
public async Task Can_Set_ContactPerson(OrganizationRole role) { //Arrange var login = await HttpApi.GetCookieAsync(role); const int organizationId = TestEnvironment.DefaultOrganizationId; var contactPersonDto = await OrganizationHelper.GetContactPersonAsync(organizationId); var name = A <string>(); var lastName = A <string>(); var email = A <string>(); var phone = A <string>(); //Act - perform the action with the actual role var result = await OrganizationHelper.ChangeContactPersonAsync(contactPersonDto.Id, organizationId, name, lastName, email, phone, login); //Assert Assert.Equal(contactPersonDto.Id, result.Id); Assert.Equal(email, result.Email); Assert.Equal(name, result.Name); Assert.Equal(lastName, result.LastName); Assert.Equal(phone, result.PhoneNumber); Assert.Equal(organizationId, result.OrganizationId); }