示例#1
0
        public void TestUser()
        {
            var adminBuilder = new AdminBuilder("Eric");
            var assemble     = new AssembleUser();

            assemble.Construct(adminBuilder);

            IUser adminUser = adminBuilder.User;

            adminUser.Description    = "didkasdlkajsldj";
            adminUser.AgencyLicence  = Guid.NewGuid();
            adminUser.CompanyFounder = new CompanyFounder
            {
                User    = adminUser,
                Company = new Company("SoftCorp", "asdasdasdasd")
            };

            UserManagement adminUserManagement = new UserManagement(adminUser);

            IUser agentUser = new Agent("Taylor");

            agentUser.Description = "asdasdasdasdasd";
            agentUser             = adminUserManagement.CreateUser(agentUser, true);

            adminUserManagement.CanSchedulePostsAndCampaings(agentUser);

            Assert.IsTrue(adminUserManagement.CanSchedulePostsAndCampaings(agentUser));
        }
示例#2
0
        public void TestUser()
        {
            var adminBuilder = new AdminBuilder("Eric");
            var assemble = new AssembleUser();
            assemble.Construct(adminBuilder);

            IUser adminUser = adminBuilder.User;
            adminUser.Description = "didkasdlkajsldj";
            adminUser.AgencyLicence = Guid.NewGuid();
            adminUser.CompanyFounder = new CompanyFounder
            {
                User = adminUser,
                Company = new Company("SoftCorp", "asdasdasdasd")
            };

            UserManagement adminUserManagement = new UserManagement(adminUser);

            IUser agentUser = new Agent("Taylor");
            agentUser.Description = "asdasdasdasdasd";
            agentUser = adminUserManagement.CreateUser(agentUser, true);

            adminUserManagement.CanSchedulePostsAndCampaings(agentUser);

            Assert.IsTrue(adminUserManagement.CanSchedulePostsAndCampaings(agentUser));
        }
示例#3
0
        static void Main(string[] args)
        {
            var adminBuilder = new AdminBuilder("Eric");
            var assemble = new AssembleUser();
            assemble.Construct(adminBuilder);

            IUser adminUser = adminBuilder.User;

            UserManagement adminUserManagement = new UserManagement(adminUser);
            IUser agentUser = adminUserManagement.CreateUser(new Agent("Taylor"), true);

            adminUserManagement.CanSchedulePostsAndCampaings(agentUser);

            Console.ReadLine();
        }