コード例 #1
0
        public void Given_a_document_and_created_by_is_not_null_when_mapped_then_createdby_is_equal()
        {
            //given
            var document = new RiskAssessmentDocument();
            document.CreatedBy = new UserForAuditing {Employee = new EmployeeForAuditing() {Forename = "foasfojasf", Surname = "dfjsdfj"}};
            document.RiskAssessment = new GeneralRiskAssessment();
            //when
            var documentDto = new DocumentDtoMapper().Map(document);

            //then
            Assert.AreEqual(document.CreatedBy.Employee.FullName, documentDto.CreatedByName);
        }
コード例 #2
0
        public void Given_a_document_and_created_by_is_null_when_mapped_then_createdby_empty_string()
        {
            //given
            var document = new RiskAssessmentDocument();
            document.CreatedBy = null;
            document.RiskAssessment = new GeneralRiskAssessment();
            //when
            var documentDto = new DocumentDtoMapper().Map(document);

            //then
            Assert.AreEqual(string.Empty,documentDto.CreatedByName);
        }