Пример #1
0
        public void CreateWatchingEntityTest()
        {
            //Arrange
            const string projectId = "projectId";

            var tableValueConverter = new Mock<ITableValueConverter>();
            var statEntityFactory = new StatEntityFactory(tableValueConverter.Object);

            tableValueConverter.Setup(m => m.DateTimeToTickWithGuid(_dateTime)).Returns(TickWithGuid);

            //Act
            var watchingEntity = statEntityFactory.CreateWatchingEntity(EventId, _dateTime, _domain, projectId);

            //Assert
            Assert.AreEqual(TickWithGuid, watchingEntity.Tick);
            Assert.AreEqual(EventId, watchingEntity.EventId);
            Assert.AreEqual(_dateTime, watchingEntity.DateTime);
            Assert.AreEqual(AnonymousId, watchingEntity.AnonymousId);
            Assert.AreEqual(IsAuthenticated, watchingEntity.IsAuthenticated);
            Assert.AreEqual(UrlReferrer, watchingEntity.UrlReferrer);
            Assert.AreEqual(projectId, watchingEntity.ProjectId);
            Assert.AreEqual(UserId, watchingEntity.UserId);
        }