상속: IGate
예제 #1
0
        public void WrapValueReturnsTheFlipperId()
        {
            var actor = MockRepository.GenerateStub<IFlipperActor>();
            actor.Stub(x => x.FlipperId).Return("User: 5");
            var gate = new ActorGate();

            Assert.That(gate.WrapValue(actor), Is.EqualTo("User: 5"));
        }
예제 #2
0
        public void IsOpenReturnsTrueWhenActorIsInSet()
        {
            var actor = MockRepository.GenerateStub<IFlipperActor>();
            actor.Stub(x => x.FlipperId).Return("5");
            var gate = new ActorGate();

            Assert.That(gate.IsOpen(actor, new HashSet<string>(new[] {"5"}), "feature"), Is.True);
        }
예제 #3
0
        public void IsOpenReturnsFalseWhenActorNotAnIFlipperActor()
        {
            var gate = new ActorGate();

            Assert.That(gate.IsOpen(new object(), new HashSet<string>(new[] {"5"}), "feature"), Is.False);
        }
예제 #4
0
        public void IsOpenReturnsFalseForNullActor()
        {
            var gate = new ActorGate();

            Assert.That(gate.IsOpen(null, new HashSet<string>(new[] {"5"}), "feature"), Is.False);
        }
예제 #5
0
 public void IsEnabledReturnsTrueForNonEmptySet()
 {
     var gate = new ActorGate();
     Assert.That(gate.IsEnabled(new HashSet<string>(new[] {"foo"})), Is.True);
 }
예제 #6
0
 public void IsEnabledReturnsFalseForEmptySet()
 {
     var gate = new ActorGate();
     Assert.That(gate.IsEnabled(new HashSet<string>()), Is.False);
 }