Ejemplo n.º 1
0
        public void ConditionTest()
        {
            string code = @"
			var greeting;
			var condition = true;

			if (condition) {
				greeting = ""Hello"";
			}
			else if (condition) {
				greeting = ""Goodbye"";
			}
			else {
				greeting = ""Greetings"";
			}

			if (!condition) {
				greeting = greeting + "" cruel"";
			}
			else if (true) {
				greeting = greeting + "" beautiful"";
			}
			else {
				greeting = greeting + "" great"";
			}

			if (false) {
				greeting = greeting + "" planet."";
			}
			else if (!condition) {
				greeting = greeting + "" earth."";
			}
			else {
				greeting = greeting + "" world."";
			}

			return greeting;"            ;

            ExecutionState <GroupState> executionState = Run(code);

            Assert.Equal(new DefaultStringValue <GroupState>("Hello beautiful world."), executionState.GetReturn());
        }