Beispiel #1
0
 public void TestInitializer()
 {
     using (var manager = new RessourceXmlService(this.LogManager))
     {
         Assert.IsNull(manager.Culture);
         Assert.IsFalse(manager.IsInitialized);
     }
 }
Beispiel #2
0
 public void TestGetSetRessourceAsync()
 {
     using (var streamsource = new FileSource("./GETSET/RessourceXml.xml"))
     {
         using (var manager = new RessourceXmlService(this.LogManager))
         {
             manager.Initialize(CultureInfo.GetCultureInfo("en"), streamsource);
             this._tester.TestGetSetRessourceAsync(manager);
         }
     }
 }
Beispiel #3
0
 public void TestGeSettRessource()
 {
     using (var streamsource = new FileSource("./GETSET/RessourceXml.xml", FileSourceSaveModeEnum.KEEPALLPREVIOUSVERSION))
     {
         using (var manager = new RessourceXmlService(this.LogManager))
         {
             manager.Initialize(CultureInfo.GetCultureInfo("en"), streamsource);
             this._tester.TestGetSetRessource(manager);
         }
     }
 }
Beispiel #4
0
 public void FailInitialize()
 {
     using (var streamsource = new FileSource("./GETSET/RessourceXml.xml"))
     {
         using (var manager = new RessourceXmlService(this.LogManager))
         {
             manager.Invoking(x => x.Initialize(null, streamsource)).Should().Throw <ArgumentNullException>();
             manager.Invoking(x => x.Initialize(CultureInfo.GetCultureInfo("en"), null)).Should().Throw <ArgumentNullException>();
         }
     }
 }
Beispiel #5
0
 public void FailGroup()
 {
     using (var streamsource = new FileSource("./Group/RessourceXml.xml"))
     {
         using (var manager = new RessourceXmlService(this.LogManager))
         {
             manager.Initialize(CultureInfo.GetCultureInfo("en"), streamsource);
             this._tester.FailGroup(manager);
         }
     }
 }
Beispiel #6
0
 public void TestContainsRessource()
 {
     using (var streamsource = new FileSource("./Contains/RessourceXml.xml"))
     {
         using (var manager = new RessourceXmlService(this.LogManager))
         {
             manager.Initialize(CultureInfo.GetCultureInfo("en"), streamsource);
             this._tester.TestContainsRessource(manager);
         }
     }
 }
Beispiel #7
0
 public void TestIntialize()
 {
     using (var streamsource = new FileSource("./GETSET/RessourceXml.xml"))
     {
         using (var manager = new RessourceXmlService(this.LogManager))
         {
             manager.Initialize(CultureInfo.GetCultureInfo("en"), streamsource);
             Assert.IsTrue(manager.Culture == CultureInfo.GetCultureInfo("en"));
             Assert.IsTrue(manager.IsInitialized);
         }
     }
 }
Beispiel #8
0
 public void TestPerformanceGetRessource()
 {
     using (var streamsource = new FileSource("./Performance/RessourceXml.xml"))
     {
         using (var managerEn = new RessourceXmlService(this.LogManager))
         {
             managerEn.Initialize(CultureInfo.GetCultureInfo("en"), streamsource);
             using (var managerFr = new RessourceXmlService(this.LogManager))
             {
                 managerFr.Initialize(CultureInfo.GetCultureInfo("fr"), streamsource);
                 this._tester.TestPerformanceGetRessource(managerEn, managerFr);
             }
         }
     }
 }