예제 #1
0
        private static ShellCommandFencer CreateFencer()
        {
            Configuration conf = new Configuration();

            conf.Set("in.fencing.tests", "yessir");
            ShellCommandFencer fencer = new ShellCommandFencer();

            fencer.SetConf(conf);
            return(fencer);
        }
예제 #2
0
 public virtual void TestCommandAbbreviation()
 {
     Assert.Equal("a...f", ShellCommandFencer.Abbreviate("abcdef",
                                                         5));
     Assert.Equal("abcdef", ShellCommandFencer.Abbreviate("abcdef",
                                                          6));
     Assert.Equal("abcdef", ShellCommandFencer.Abbreviate("abcdef",
                                                          7));
     Assert.Equal("a...g", ShellCommandFencer.Abbreviate("abcdefg",
                                                         5));
     Assert.Equal("a...h", ShellCommandFencer.Abbreviate("abcdefgh"
                                                         , 5));
     Assert.Equal("a...gh", ShellCommandFencer.Abbreviate("abcdefgh"
                                                          , 6));
     Assert.Equal("ab...gh", ShellCommandFencer.Abbreviate("abcdefgh"
                                                           , 7));
 }