예제 #1
0
        public void GetAliasString_ReturnsEmptyString_WhenPassedNoAlias()
        {
            var service = new ParameterService();
            var pi      = typeof(ParameterServiceTests)
                          .GetMethod("FakeMethod")
                          .GetParameters()[0];

            var actual = service.GetAliasString(pi);

            Assert.AreEqual("", actual);
        }
예제 #2
0
        public void GetAliasString_ReturnsString_WhenPassedAlias()
        {
            var service = new ParameterService();
            var pi      = typeof(ParameterServiceTests)
                          .GetMethod("FakeMethod")
                          .GetParameters()[1];
            var expectedPrefix = "--";

            _mockSetting.Setup(s => s.ArgumentPrefix()).Returns(expectedPrefix);

            var actual   = service.GetAliasString(pi);
            var expected = $" | {expectedPrefix}{_expectedAlias}";

            Assert.AreEqual(expected, actual);
        }