public void Map_To_InterfaceDtoOnlyCreatesValidData() { var dto = new ItInterfaceDTO { OrganizationId = A <int>(), Name = A <string>(), ItInterfaceId = A <string>() }; var itInterface = Mapper.Map <ItInterfaceDTO, ItInterface>(dto); Assert.Null(itInterface.AssociatedSystemRelations); Assert.Null(itInterface.BrokenLinkReports); Assert.NotNull(itInterface.DataRows); //Set by ctor Assert.Null(itInterface.ExhibitedBy); Assert.Null(itInterface.Interface); Assert.Null(itInterface.InterfaceId); Assert.Null(itInterface.LastChangedByUser); Assert.Null(itInterface.LastChangedByUserId); Assert.Null(itInterface.Organization); Assert.Null(itInterface.ObjectOwnerId); Assert.Null(itInterface.ObjectOwner); //Check the expected mappings Assert.Equal(dto.OrganizationId, itInterface.OrganizationId); Assert.Equal(dto.ItInterfaceId, itInterface.ItInterfaceId); Assert.Equal(dto.Name, itInterface.Name); }
public static async Task <ItInterfaceDTO> CreateInterface(ItInterfaceDTO input) { var cookie = await HttpApi.GetCookieAsync(OrganizationRole.GlobalAdmin); var url = TestEnvironment.CreateUrl("api/itinterface"); using (var createdResponse = await HttpApi.PostWithCookieAsync(url, cookie, input)) { Assert.Equal(HttpStatusCode.Created, createdResponse.StatusCode); return(await createdResponse.ReadResponseBodyAsKitosApiResponseAsync <ItInterfaceDTO>()); } }
private static async Task <ItInterfaceExhibitDTO> CreateExhibitAsync(ItInterfaceDTO exposedInterface, ItSystemDTO exposingSystem) { return(await InterfaceExhibitHelper.CreateExhibit(exposingSystem.Id, exposedInterface.Id)); }