Beispiel #1
0
 public SuiteResult Map(DbSuiteResult dbSuiteResult)
 {
     return(new SuiteResult
     {
         SuiteResultID = dbSuiteResult.SuiteResultID
     });
 }
            public void CorrectlyMaps()
            {
                var now = DateTime.Now;

                var domainSuiteResult = new DomainSuiteResult
                {
                    Suite = new Suite {
                        SuiteID = 1
                    },
                    EndTime    = now,
                    ResultType = DomainSuiteResultType.Pass
                };

                var dbSuiteResult = new DbSuiteResult
                {
                    SuiteResultID = 2,
                    SuiteId       = 7
                };

                var suiteResultMapper   = new SuiteResultMapper();
                var mappedDbSuiteResult = suiteResultMapper.Map(dbSuiteResult, domainSuiteResult);

                Assert.AreEqual(2, mappedDbSuiteResult.SuiteResultID);
                Assert.AreEqual(7, mappedDbSuiteResult.SuiteId);
                Assert.AreEqual(now, mappedDbSuiteResult.SuiteResultEndDateTime);
                Assert.AreEqual(3, dbSuiteResult.SuiteResultTypeId);
            }
Beispiel #3
0
 public DbSuiteResult Map(DbSuiteResult dbSuiteResult, SuiteResult suiteResult)
 {
     dbSuiteResult.SuiteResultEndDateTime = suiteResult.EndTime;
     dbSuiteResult.SuiteResultTypeId      = Map(suiteResult.ResultType);
     return(dbSuiteResult);
 }