示例#1
0
        public void CondoPermission_Must_Not_Add_RepeatedFunctionality_With_LowerRole()
        {
            var condoPermission = new CondoPermission
            {
                Condo = 1
            };

            var firstPermission = new Permission
            {
                Functionality = "Entregas",
                Role          = Role.Escrita
            };

            var secondPermission = new Permission
            {
                Functionality = "Entregas",
                Role          = Role.Leitura
            };

            condoPermission.AddPermisson(firstPermission);
            condoPermission.AddPermisson(secondPermission);

            Assert.IsTrue(condoPermission.Permissions.Count == 1);
            Assert.IsFalse(condoPermission.Permissions.Contains(secondPermission));
        }
示例#2
0
        public void CondoPermission_Must_Not_Add_RepeatedPermission()
        {
            var condoPermission = new CondoPermission
            {
                Condo = 1
            };

            var firstPermission = new Permission
            {
                Functionality = "Entregas",
                Role          = Role.Escrita
            };

            condoPermission.AddPermisson(firstPermission);
            condoPermission.AddPermisson(firstPermission);

            Assert.IsTrue(condoPermission.Permissions.Count == 1);
        }
示例#3
0
        public void CondoPermission_Must_Add_New_Permission()
        {
            var condoPermission = new CondoPermission
            {
                Condo = 1
            };

            var permission = new Permission
            {
                Functionality = "Entregas",
                Role          = Role.Escrita
            };

            condoPermission.AddPermisson(permission);

            Assert.IsTrue(condoPermission.Permissions.Count > 0);
            Assert.IsTrue(condoPermission.Permissions.Contains(permission));
        }