Ejemplo n.º 1
0
        public void StatProjectUploadingToDomainTest()
        {
            //Arrange
            var uploadingEntity = new StatProjectUploadingV2Entity()
                {
                    Tick = "tick",
                    DateTime = new DateTime(23456345344),
                    UserId = "userId",
                    EventId = "eventId",
                    ProductName = "productName",
                    ProjectId = "projectId"
                };

            var statMapper = new StatMapper();

            //Act
            var domain = statMapper.StatProjectUploadingToDomain(uploadingEntity);

            //Assert
            Assert.AreEqual(uploadingEntity.Tick, domain.Tick);
            Assert.AreEqual(uploadingEntity.DateTime, domain.DateTime);
            Assert.AreEqual(uploadingEntity.EventId, domain.EventId);
            Assert.AreEqual(uploadingEntity.UserId, domain.UserId);
            Assert.AreEqual(uploadingEntity.ProductName, domain.ProductName);
            Assert.AreEqual(uploadingEntity.ProjectId, domain.ProjectId);
        }
Ejemplo n.º 2
0
        public void StatUserRegistrationToDomainTest()
        {
            //Arrange
            var registrationEntity = new StatUserRegistrationV2Entity()
            {
                Tick="tick",
                DateTime = new DateTime(23456345344),
                UserId = "userId",
                EventId = "eventId",
                IdentityProvider="identityProvider",
                ProductName = "productName"
            };

            var statMapper = new StatMapper();

            //Act
            var domain = statMapper.StatUserRegistrationToDomain(registrationEntity);

            //Assert
            Assert.AreEqual(registrationEntity.Tick, domain.Tick);
            Assert.AreEqual(registrationEntity.DateTime, domain.DateTime);
            Assert.AreEqual(registrationEntity.EventId, domain.EventId);
            Assert.AreEqual(registrationEntity.UserId, domain.UserId);
            Assert.AreEqual(registrationEntity.IdentityProvider, domain.IdentityProvider);
            Assert.AreEqual(registrationEntity.ProductName, domain.ProductName);
        }
Ejemplo n.º 3
0
        public void StatWatchingEntityToDomainTest()
        {
            //Arrange
            var watchingEntity = new StatWatchingV2Entity()
                {
                    AnonymousId = "AnonymousId",
                    DateTime = new DateTime(23456345344),
                    ProjectId = "projectId",
                    UrlReferrer = "urlReferrer",
                    UserId = "userId",
                    IsAuthenticated = true,
                    Tick = "tick",
                    EventId = "eventId"
                };

            var statMapper = new StatMapper();

            //Act
            var domain = statMapper.StatWatchingToDomain(watchingEntity);

            //Assert
            Assert.AreEqual(watchingEntity.Tick, domain.Tick);
            Assert.AreEqual(watchingEntity.AnonymousId, domain.AnonymousId);
            Assert.AreEqual(watchingEntity.DateTime, domain.DateTime);
            Assert.AreEqual(watchingEntity.EventId, domain.EventId);
            Assert.AreEqual(watchingEntity.IsAuthenticated, domain.IsAuthenticated);
            Assert.AreEqual(watchingEntity.ProjectId, domain.ProjectId);
            Assert.AreEqual(watchingEntity.UrlReferrer, domain.UrlReferrer);
            Assert.AreEqual(watchingEntity.UserId, domain.UserId);
        }
Ejemplo n.º 4
0
        public void StatProjectStateToDomain()
        {
            //Arrange
            const bool isSuccessfulUopload = true;

            var projectStateEntity = new StatProjectStateV3Entity()
                {
                    ProjectId = "projectId",
                    ActionType = "actionType",
                    DateTime = new DateTime(23456345344),
                    Producer = "producer",
                    Version = "version"
                };

            var statMapper = new StatMapper();

            //Act
            var domain = statMapper.StatProjectStateToDomain(projectStateEntity, isSuccessfulUopload);

            //Assert
            Assert.AreEqual(projectStateEntity.ProjectId, domain.ProjectId);
            Assert.AreEqual(projectStateEntity.Producer, domain.Producer);
            Assert.AreEqual(projectStateEntity.Version, domain.Version);
            Assert.AreEqual(projectStateEntity.DateTime,domain.DateTime);
            Assert.AreEqual(isSuccessfulUopload,domain.IsSuccessfulUpload);
        }