예제 #1
0
        public void ToAssembly_GivenCommandOutOfFunction_ReturnsExpected(string label)
        {
            var expected = new [] { $"(foo.{label})" };

            var sut = new LabelTranslatorBuilder()
                      .WithFilename("foo")
                      .CreateSut();

            var actual = sut.ToAssembly($"label {label}");

            Assert.Equal(expected, actual);
        }
예제 #2
0
        public void ToAssembly_GivenCommandInFunction_ReturnsExpected(string label)
        {
            var expected = new [] { $"(foo.bar${label})" };

            var functionState = new FunctionState
            {
                CurrentFunction = "bar"
            };

            var sut = new LabelTranslatorBuilder()
                      .WithFilename("foo")
                      .WithFunctionState(functionState)
                      .CreateSut();

            var actual = sut.ToAssembly($"label {label}");

            Assert.Equal(expected, actual);
        }
예제 #3
0
        public void ToAssembly_GivenInvalidCommand_ThrowsException()
        {
            var sut = new LabelTranslatorBuilder().CreateSut();

            Assert.Throws <InvalidOperationException>(() => sut.ToAssembly($"label"));
        }