コード例 #1
0
        public void CreateUserTest()
        {
            //Arrange
            const string projectId      = "projectId";
            const string projectName    = "projectName";
            const string projectType    = "projectType";
            const string projectSubtype = "projectSubtype";

            var user = new FakeDomainStatUser();

            //Act
            var project = new DomainStatProject(user, projectId, projectName, projectType, projectSubtype);

            //Assert
            Assert.AreEqual(user, project.User);
            Assert.AreEqual(projectId, project.ProjectId);
            Assert.AreEqual(projectName, project.ProjectName);
            Assert.AreEqual(projectType, project.ProjectType);
            Assert.AreEqual(projectSubtype, project.ProjectSubtype);
        }
コード例 #2
0
        public void CreateUserTest()
        {
            //Arrange
            const string projectId = "projectId";
            const string projectName = "projectName";
            const string projectType = "projectType";
            const string projectSubtype = "projectSubtype";

            var user = new FakeDomainStatUser();

            //Act
            var project = new DomainStatProject(user, projectId, projectName, projectType, projectSubtype);

            //Assert
            Assert.AreEqual(user, project.User);
            Assert.AreEqual(projectId, project.ProjectId);
            Assert.AreEqual(projectName, project.ProjectName);
            Assert.AreEqual(projectType, project.ProjectType);
            Assert.AreEqual(projectSubtype, project.ProjectSubtype);
        }
コード例 #3
0
        public void IdentifyUserTest()
        {
            //Arrange
            var timeSpan = new DateTime(2013, 7, 16);
            var actionDomain = new DomainActionData();
            var user = new FakeDomainStatUser();

            var eventLogger = new Mock<IEventLogger>();
            var statDomainFactory = new Mock<IStatDomainFactory>();
            var dateTimeWrapper = new Mock<IDateTimeWrapper>();

            var userRegistrationEventService = new UserIdentifyEventService(eventLogger.Object, statDomainFactory.Object, dateTimeWrapper.Object);

            statDomainFactory.Setup(m => m.CreateUser(actionDomain)).Returns(user);
            dateTimeWrapper.Setup(m => m.CurrentDateTime()).Returns(timeSpan);

            //Act
            userRegistrationEventService.IdentifyUser(actionDomain);

            //Assert
            eventLogger.Verify(m => m.Identify(user, timeSpan), Times.Once());
        }
コード例 #4
0
        public void IdentifyUserTest()
        {
            //Arrange
            var timeSpan     = new DateTime(2013, 7, 16);
            var actionDomain = new DomainActionData();
            var user         = new FakeDomainStatUser();

            var eventLogger       = new Mock <IEventLogger>();
            var statDomainFactory = new Mock <IStatDomainFactory>();
            var dateTimeWrapper   = new Mock <IDateTimeWrapper>();

            var userRegistrationEventService = new UserIdentifyEventService(eventLogger.Object, statDomainFactory.Object, dateTimeWrapper.Object);

            statDomainFactory.Setup(m => m.CreateUser(actionDomain)).Returns(user);
            dateTimeWrapper.Setup(m => m.CurrentDateTime()).Returns(timeSpan);

            //Act
            userRegistrationEventService.IdentifyUser(actionDomain);

            //Assert
            eventLogger.Verify(m => m.Identify(user, timeSpan), Times.Once());
        }