Get() 공개 메소드

public Get ( string key ) : string
key string
리턴 string
예제 #1
0
        public void shallow_clone()
        {
            Step step = new Step("key").With("a:1,b:2,c:3");
            IStep clone = step.ShallowClone();

            clone.ShouldNotBeTheSameAs(step);
            clone.GrammarKey.ShouldEqual("key");
            clone.Get("a").ShouldEqual(step.Get("a"));
            clone.Get("b").ShouldEqual(step.Get("b"));
            clone.Get("c").ShouldEqual(step.Get("c"));
        }
        public void execute_successfully()
        {
            ReflectionAssertion assertion = ReflectionAssertion.Create(x => x.Success(), new AssertionFixture());
            var step = new Step();

            var context = new TestContext();

            assertion.Execute(step, context);
            context.Counts.ShouldEqual(1, 0, 0, 0);

            step.Get("returnValue").Parse<bool>().ShouldBeTrue();
            context.ResultsFor(step).ActualDisplay<bool>("returnValue").ShouldBeTrue();
        }
        public void execute_with_exception()
        {
            ReflectionAssertion assertion = ReflectionAssertion.Create(x => x.Exception(), new AssertionFixture());
            var step = new Step();

            var context = new TestContext();

            assertion.Execute(step, context);
            context.Counts.ShouldEqual(0, 0, 1, 0);

            step.Get("returnValue").Parse<bool>().ShouldBeTrue();
            context.ResultsFor(step).ActualDisplay<bool>("returnValue").ShouldBeFalse();
            context.ResultsFor(step).ExceptionText.ShouldContain("NotImplementedException");
        }
        public void execute_with_false()
        {
            FactAssertion assertion = FactAssertion.Create(x => x.Failure(), new AssertionFixture());
            var step = new Step();
            var context = new TestContext();

            assertion.Execute(step, context);
            context.Counts.ShouldEqual(0, 1, 0, 0);

            step.Get("returnValue").Parse<bool>().ShouldBeTrue();
            context.ResultsFor(step).ActualDisplay<bool>("returnValue").ShouldBeFalse();
        }