public virtual void test_of_escaping() { PropertiesFile test = PropertiesFile.of(CharSource.wrap(FILE3)); Multimap <string, string> keyValues1 = ImmutableListMultimap.of("a=d=", "x"); assertEquals(test.Properties, PropertySet.of(keyValues1)); }
public virtual void test_of_set() { Multimap <string, string> keyValues = ImmutableListMultimap.of("a", "x", "b", "y"); PropertiesFile test = PropertiesFile.of(PropertySet.of(keyValues)); assertEquals(test.Properties, PropertySet.of(keyValues)); assertEquals(test.ToString(), "{a=[x], b=[y]}"); }
public virtual void test_of_propertyNoEquals() { PropertiesFile test = PropertiesFile.of(CharSource.wrap("b\n")); Multimap <string, string> keyValues = ImmutableListMultimap.of("b", ""); assertEquals(test.Properties, PropertySet.of(keyValues)); assertEquals(test.ToString(), "{b=[]}"); }
public virtual void test_of_list() { PropertiesFile test = PropertiesFile.of(CharSource.wrap(FILE2)); Multimap <string, string> keyValues = ImmutableListMultimap.of("a", "x", "a", "y"); assertEquals(test.Properties, PropertySet.of(keyValues)); assertEquals(test.ToString(), "{a=[x, y]}"); }
public virtual void test_of_noLists() { PropertiesFile test = PropertiesFile.of(CharSource.wrap(FILE1)); Multimap <string, string> keyValues = ImmutableListMultimap.of("a", "x", "c", "z", "b", "y"); assertEquals(test.Properties, PropertySet.of(keyValues)); assertEquals(test.ToString(), "{a=[x], c=[z], b=[y]}"); }
//------------------------------------------------------------------------- public virtual void test_equalsHashCode() { PropertiesFile a1 = PropertiesFile.of(CharSource.wrap(FILE1)); PropertiesFile a2 = PropertiesFile.of(CharSource.wrap(FILE1)); PropertiesFile b = PropertiesFile.of(CharSource.wrap(FILE2)); assertEquals(a1.Equals(a1), true); assertEquals(a1.Equals(a2), true); assertEquals(a1.Equals(b), false); assertEquals(a1.Equals(null), false); assertEquals(a1.Equals(ANOTHER_TYPE), false); assertEquals(a1.GetHashCode(), a2.GetHashCode()); }
public virtual void test_of_ioException() { assertThrows(() => PropertiesFile.of(Files.asCharSource(new File("src/test/resources"), StandardCharsets.UTF_8)), typeof(UncheckedIOException)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test(expectedExceptions = IllegalArgumentException.class) public void test_of_invalid_emptyKey() public virtual void test_of_invalid_emptyKey() { string invalid = "= y\n"; PropertiesFile.of(CharSource.wrap(invalid)); }