コード例 #1
0
 public void TestInitializer()
 {
     using (var manager = new RessourceXmlService(this.LogManager))
     {
         Assert.IsNull(manager.Culture);
         Assert.IsFalse(manager.IsInitialized);
     }
 }
コード例 #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);
         }
     }
 }
コード例 #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);
         }
     }
 }
コード例 #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>();
         }
     }
 }
コード例 #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);
         }
     }
 }
コード例 #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);
         }
     }
 }
コード例 #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);
         }
     }
 }
コード例 #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);
             }
         }
     }
 }