示例#1
0
        public void ConditionHoldsShouldThrowExceptionWhenContextIsNotProvided()
        {
            // Arrange
            var now       = DateTime.UtcNow;
            var condition = new UsersCondition("USER#1", "USER#2");

            // Act

            // Assert
            Assert.Throws <ArgumentNullException>(() => condition.Holds(null));
        }
示例#2
0
        public void ConditionHoldsShouldReturnTrueWhenUserIsInUsersCollection()
        {
            // Arrange
            var user      = "******";
            var condition = new UsersCondition("USER#1", "USER#2", "SAMPLE_USER");
            var context   = new Context(null, user, null);

            // Act
            var conditionHolds = condition.Holds(context);

            // Assert
            Assert.True(conditionHolds);
        }