Пример #1
0
 public void ConstructorThrowsOnDuplicateKeyWhenSpecified()
 {
     // We take a test resource file with a duplicate TimeZoneId which should then throw an ArgumentException.
     _ = new StrictTestMapper(
         xmldata: File.ReadAllText("testfiles/duplicatekey.xml"),
         throwOnDuplicateKey: true,
         throwOnNonExisting: true
         );
 }
Пример #2
0
 public void ConstructorDoesNotThrowOnDuplicateKeyWhenSpecified()
 {
     // We take a test resource file with a duplicate TimeZoneId which should NOT throw an ArgumentException
     // because we set throwOnDuplicateKey to false.
     _ = new StrictTestMapper(
         xmldata: File.ReadAllText("testfiles/duplicatekey.xml"),
         throwOnDuplicateKey: false,
         throwOnNonExisting: true
         );
 }
Пример #3
0
 public void ConstructorDoesNotThrowOnNonExistingTimeZoneIdWhenSpecified()
 {
     // We take a test resource file with a non-existing TimeZoneId (i.e. .Net won't recognize the TimeZoneId)
     // which should NOT throw a TimeZoneNotFoundException because we set throwOnNonExisting to false.
     _ = new StrictTestMapper(
         xmldata: File.ReadAllText("testfiles/nonexisting.xml"),
         throwOnDuplicateKey: true,
         throwOnNonExisting: false
         );
 }
Пример #4
0
 public void EnsureResourceFileIsValid()
 {
     // We take the ACTUAL resourcefile and load it in the StrictTestMapper which will throw on duplicate
     // keys and/or non-existing timezone ID's. This should NOT throw any exceptions.
     _ = new StrictTestMapper(
         xmldata: File.ReadAllText("../../../../TimeZoneMapper/ResourceFiles/windowsZones.xml"),
         throwOnDuplicateKey: true,
         throwOnNonExisting: true
         );
 }