Beispiel #1
0
        public void Verify_MapToEntity_AssignsLocationIssueProperties()
        {
            // Arrange
            var mapper = new LocationIssueMapper();
            var model  = LocationIssuesMockingSetup.DoMockingSetupForLocationIssueModel();
            // Act
            var entity = mapper.MapToEntity(model.Object);

            // Assert
            // <None>
            // Related Objects
            Assert.Equal(model.Object.LocationId, entity.LocationId);
            Assert.Equal(model.Object.IssueId, entity.IssueId);
            // Associated Objects
            // <None>
        }
Beispiel #2
0
        public void Verify_MapToSearchModel_AssignsLocationIssueSearchProperties()
        {
            // Arrange
            var mapper = new LocationIssueMapper();
            var model  = LocationIssuesMockingSetup.DoMockingSetupForLocationIssueModel();
            // Act
            var searchModel = mapper.MapToSearchModel(model.Object);

            // Assert
            Assert.Equal(model.Object.LocationId, searchModel.LocationId);
            Assert.Equal(model.Object.Location?.CustomKey, searchModel.LocationCustomKey);
            Assert.Equal(model.Object.Location?.ApiDetailUrl, searchModel.LocationApiDetailUrl);
            Assert.Equal(model.Object.Location?.SiteDetailUrl, searchModel.LocationSiteDetailUrl);
            Assert.Equal(model.Object.Location?.Name, searchModel.LocationName);
            Assert.Equal(model.Object.Location?.ShortDescription, searchModel.LocationShortDescription);
            Assert.Equal(model.Object.Location?.Description, searchModel.LocationDescription);
            Assert.Equal(model.Object.IssueId, searchModel.IssueId);
            Assert.Equal(model.Object.Issue?.CustomKey, searchModel.IssueCustomKey);
            Assert.Equal(model.Object.Issue?.ApiDetailUrl, searchModel.IssueApiDetailUrl);
            Assert.Equal(model.Object.Issue?.SiteDetailUrl, searchModel.IssueSiteDetailUrl);
            Assert.Equal(model.Object.Issue?.Name, searchModel.IssueName);
            Assert.Equal(model.Object.Issue?.ShortDescription, searchModel.IssueShortDescription);
            Assert.Equal(model.Object.Issue?.Description, searchModel.IssueDescription);
        }
 public void Verify_MapToSearchModel_AssignsLocationIssueSearchProperties()
 {
     // Arrange
     var mapper = new LocationIssueMapper();
     var model = LocationIssuesMockingSetup.DoMockingSetupForLocationIssueModel();
     // Act
     var searchModel = mapper.MapToSearchModel(model.Object);
     // Assert
     Assert.Equal(model.Object.LocationId, searchModel.LocationId);
     Assert.Equal(model.Object.Location?.CustomKey, searchModel.LocationCustomKey);
     Assert.Equal(model.Object.Location?.ApiDetailUrl, searchModel.LocationApiDetailUrl);
     Assert.Equal(model.Object.Location?.SiteDetailUrl, searchModel.LocationSiteDetailUrl);
     Assert.Equal(model.Object.Location?.Name, searchModel.LocationName);
     Assert.Equal(model.Object.Location?.ShortDescription, searchModel.LocationShortDescription);
     Assert.Equal(model.Object.Location?.Description, searchModel.LocationDescription);
     Assert.Equal(model.Object.IssueId, searchModel.IssueId);
     Assert.Equal(model.Object.Issue?.CustomKey, searchModel.IssueCustomKey);
     Assert.Equal(model.Object.Issue?.ApiDetailUrl, searchModel.IssueApiDetailUrl);
     Assert.Equal(model.Object.Issue?.SiteDetailUrl, searchModel.IssueSiteDetailUrl);
     Assert.Equal(model.Object.Issue?.Name, searchModel.IssueName);
     Assert.Equal(model.Object.Issue?.ShortDescription, searchModel.IssueShortDescription);
     Assert.Equal(model.Object.Issue?.Description, searchModel.IssueDescription);
 }
 public void Verify_MapToModel_AssignsLocationIssueProperties()
 {
     // Arrange
     var mapper = new LocationIssueMapper();
     var entity = LocationIssuesMockingSetup.DoMockingSetupForLocationIssue();
     // Act
     var model = mapper.MapToModel(entity.Object);
     // Assert
     // <None>
     // Related Objects
     Assert.Equal(entity.Object.LocationId, model.LocationId);
     Assert.Equal(entity.Object.IssueId, model.IssueId);
     // Associated Objects
     // <None>
 }
 public void Verify_MapToEntity_WithExistingEntity_AssignsLocationIssueProperties()
 {
     // Arrange
     var mapper = new LocationIssueMapper();
     var model = LocationIssuesMockingSetup.DoMockingSetupForLocationIssueModel();
     // Act
     ILocationIssue existingEntity = new LocationIssue { Id = 1 };
     mapper.MapToEntity(model.Object, ref existingEntity);
     // Assert
     // <None>
     // Related Objects
     Assert.Equal(model.Object.LocationId, existingEntity.LocationId);
     Assert.Equal(model.Object.IssueId, existingEntity.IssueId);
     // Associated Objects
     // <None>
 }
 public void Verify_AreEqual_WithEqualObjects_ReturnsTrue()
 {
     // Arrange
     var mapper = new LocationIssueMapper();
     var model = LocationIssuesMockingSetup.DoMockingSetupForLocationIssueModel(1);
     var entity = LocationIssuesMockingSetup.DoMockingSetupForLocationIssue(1);
     // Act
     var result = mapper.AreEqual(model.Object, entity.Object);
     // Assert
     Assert.True(result);
 }
Beispiel #7
0
 public ILocationIssueModel Get(string key)
 {
     BusinessWorkflowBase.ValidateRequiredKey(key);
     return(LocationIssueMapper.MapToModel(LocationIssuesRepository.Get(key)));
 }
Beispiel #8
0
 public ILocationIssueModel Get(int id)
 {
     BusinessWorkflowBase.ValidateRequiredID(id);
     return(LocationIssueMapper.MapToModel(LocationIssuesRepository.Get(id)));
 }