コード例 #1
0
        private void GivenSiteVisitStoredInUserSession(Guid endConditionId, Guid siteVisitId, byte endSky, string endTempUnit,
                                                       int endTemp, byte endWind, DateTime endDateTime, Guid locationid, Guid observerId, Guid recorderId,
                                                       DateTime startDateTime, Guid startConditionId, byte startSky, string startTempUnit, int startTemp)
        {
            var siteVisit = new SiteVisit
            {
                EndConditions = new SiteCondition
                {
                    Id          = endConditionId,
                    SiteVisitId = siteVisitId,
                    Sky         = endSky,
                    Temperature = new Temperature {
                        Units = endTempUnit, Value = endTemp
                    },
                    Wind = endWind
                },
                EndTimeStamp    = endDateTime,
                Id              = siteVisitId,
                LocationId      = locationid,
                ObserverId      = observerId,
                RecorderId      = recorderId,
                StartTimeStamp  = startDateTime,
                StartConditions = new SiteCondition
                {
                    Id          = startConditionId,
                    SiteVisitId = siteVisitId,
                    Sky         = startSky,
                    Temperature = new Temperature {
                        Units = startTempUnit, Value = startTemp
                    }
                }
            };

            UserStateMock.SetupGet(x => x.SiteVisit).Returns(siteVisit);
        }
コード例 #2
0
 private void GivenThereIsNoSiteVisitInSession()
 {
     UserStateMock.SetupGet(x => x.SiteVisit)
     .Returns(null as SiteVisit);
 }