public async Task CanModifyArchiveDutyValues(ArchiveDutyRecommendationTypes recommendation) { //Arrange const int organizationId = TestEnvironment.DefaultOrganizationId; var comment = A <string>(); var system = await ItSystemHelper.CreateItSystemInOrganizationAsync(A <string>(), organizationId, AccessModifier.Public); var initialValues = await ItSystemHelper.GetSystemAsync(system.Id); //Act using (var changeDutyResponse = await ItSystemHelper.SendChangeArchiveDutyRecommendationRequestAsync(system.Id, recommendation)) using (var changeCommentResponse = await ItSystemHelper.SendChangeArchiveDutyRecommendationCommentRequestAsync(system.Id, comment)) { //Assert - initial and changed values Assert.Equal(HttpStatusCode.OK, changeDutyResponse.StatusCode); Assert.Equal(HttpStatusCode.OK, changeCommentResponse.StatusCode); Assert.Null(initialValues.ArchiveDuty); Assert.Null(initialValues.ArchiveDutyComment); var changedValues = await ItSystemHelper.GetSystemAsync(system.Id); Assert.Equal(recommendation, changedValues.ArchiveDuty); Assert.Equal(comment, changedValues.ArchiveDutyComment); } }
public async Task BelongsTo_Is_Same_As_Exhibit_System() { //Arrange const int organizationId = TestEnvironment.DefaultOrganizationId; var interfaceDto = await InterfaceHelper.CreateInterface(InterfaceHelper.CreateInterfaceDto(A <string>(), A <string>(), organizationId, AccessModifier.Public)); var system = await ItSystemHelper.CreateItSystemInOrganizationAsync(A <string>(), organizationId, AccessModifier.Public); //Act - perform the action with the actual role await InterfaceExhibitHelper.CreateExhibit(system.Id, interfaceDto.Id); //Assert var interfaceResult = await InterfaceHelper.GetInterfaceById(interfaceDto.Id); var systemResult = await ItSystemHelper.GetSystemAsync(system.Id); Assert.Equal(systemResult.BelongsToName, interfaceResult.BelongsToName); }
public async Task Can_Create_Reference_In_ItSystem() { //Arrange var systemDto = await ItSystemHelper.CreateItSystemInOrganizationAsync(A <string>(), TestEnvironment.DefaultOrganizationId, AccessModifier.Public); //Act - create two similar references... we expect the first one to be the master var expectedMasterReference = await ReferencesHelper.CreateReferenceAsync(_title, _externalReferenceId, _referenceUrl, _display, dto => dto.ItSystem_Id = systemDto.Id); await ReferencesHelper.CreateReferenceAsync(_title, _externalReferenceId, _referenceUrl, _display, dto => dto.ItSystem_Id = systemDto.Id); //Assert AssertCreatedReference(_title, expectedMasterReference, _externalReferenceId, _referenceUrl, _display); systemDto = await ItSystemHelper.GetSystemAsync(systemDto.Id); Assert.Equal(2, systemDto.ExternalReferences.Count); Assert.Equal(expectedMasterReference.Id, systemDto.ReferenceId.GetValueOrDefault(-1)); //First reference must be marked as "the reference" }