コード例 #1
0
 public void IdFromNameGeneratorTestNameIsContainingDashThatShouldBeReplacedByUnderscore()
 {
     const string name = "Downloads · loresoft-msbuildtasks.dll";
     const string postfix = "WiXComponent";
     const string expected = "Id_Downloads_loresoft_msbuildtasks_dll_1234567890_WiXComponent";
     var target = new IdFromNameGenerator(_stubRandomNumberGenerator, _logger);
     var actual = target.GetId(name, postfix);
     Assert.AreEqual(expected, actual);
     Assert.IsTrue(actual.Length <= 72, "Id length is longer than 72: " + actual + " " + actual.Length);
 }        
コード例 #2
0
 public void IdFromNameGeneratorTestNameIsContainingPlusesThatShouldBeReplacedByUnderscore()
 {
     const string name = "portable-net40+sl5+wp80+win8+wpa81.dll";
     const string postfix = "WiXComponent";
     const string expected = "Id_portable_net40_sl5_wp80_win8_wpa81_dll_1234567890_WiXComponent";
     var target = new IdFromNameGenerator(_stubRandomNumberGenerator, _logger);
     var actual = target.GetId(name, postfix);
     Assert.AreEqual(expected, actual);
     Assert.IsTrue(actual.Length <= 72, "Id length is longer than 72: " + actual + " " + actual.Length);
 }
コード例 #3
0
 public void IdFromNameGeneratorTestNameIsLongReturnIdShorterThan72()
 {
     const string name = "Castle.Services.Logging.Log4netIntegration.dll";
     const string postfix = "WiXComponent";
     const string expected = "Id_Castle_Services_Logging_Log4netIntegrati_1234567890_WiXComponent";
     var target = new IdFromNameGenerator(_stubRandomNumberGenerator, _logger);
     var actual = target.GetId(name, postfix);
     Assert.AreEqual(expected, actual);
     Assert.IsTrue(actual.Length <= 72,"Id length is longer than 72: " + actual + " " + actual.Length);
 }
コード例 #4
0
 public void IdFromNameGeneratorTestNameIsContainingParantecesThatShouldBeReplacedByNothing()
 {
     const string name = "Castle.Services.(null).Logging.Log4netIntegration.dll";
     const string postfix = "WiXComponent";
     const string expected = "Id_Castle_Services_null_Logging_Log4netInte_1234567890_WiXComponent";
     var target = new IdFromNameGenerator(_stubRandomNumberGenerator, _logger);
     var actual = target.GetId(name, postfix);
     Assert.AreEqual(expected, actual);
     Assert.IsTrue(actual.Length <= 72, "Id length is longer than 72: " + actual + " " + actual.Length);
 }
コード例 #5
0
 public void IdFromNameGeneratorTestNameIsShortReturnIdShorterThan72()
 {
     const string name = "Microsoft.Practices.dll";
     const string postfix = "WiXComponent";
     const string expected = "Id_Microsoft_Practices_dll_1234567890_WiXComponent";
     var target = new IdFromNameGenerator(_stubRandomNumberGenerator,_logger);
     var actual = target.GetId(name, postfix);
     Assert.AreEqual(expected,actual);
     Assert.IsTrue(actual.Length <= 72, "Id length is longer than 72");
     Assert.IsTrue(actual.Length < 72, "Id length is not shorter than 72");
 }