Exemple #1
0
        public void Should_not_be_equal_when_roles_count_differ()
        {
            var instance1 = new RequireRolePolicy("Editor", "Writer");
            var instance2 = new RequireRolePolicy("Writer");

            Assert.That(instance1.Equals(instance2), Is.False);
            Assert.That(instance1 == instance2, Is.False);
            Assert.That(instance1 != instance2, Is.True);

            var instance3 = new RequireRolePolicy(UserRole.Owner, UserRole.Writer, UserRole.Publisher);
            var instance4 = new RequireRolePolicy(UserRole.Owner);

            Assert.That(instance3.Equals(instance4), Is.False);
            Assert.That(instance3 == instance4, Is.False);
            Assert.That(instance3 != instance4, Is.True);
        }
Exemple #2
0
        public void Should_be_equal()
        {
            var instance1 = new RequireRolePolicy("Editor");
            var instance2 = new RequireRolePolicy("Editor");

            Assert.That(instance1.Equals(instance2), Is.True);
            Assert.That(instance1 == instance2, Is.True);
            Assert.That(instance1 != instance2, Is.False);

            var instance3 = new RequireRolePolicy(UserRole.Writer);
            var instance4 = new RequireRolePolicy(UserRole.Writer);

            Assert.That(instance3.Equals(instance4), Is.True);
            Assert.That(instance3 == instance4, Is.True);
            Assert.That(instance3 != instance4, Is.False);
        }
Exemple #3
0
        public void Should_not_be_equal_when_comparing_to_null()
        {
            var instance = new RequireRolePolicy("Editor");

            Assert.That(instance.Equals(null), Is.False);
        }