public void Store_Then_Get() { // Arrange var element1 = XElement.Parse(@"<element1 />"); var element2 = XElement.Parse(@"<element1 />"); var element3 = XElement.Parse(@"<element1 />"); var repository = new EphemeralXmlRepository(null); // Act & assert repository.StoreElement(element1, "Invalid friendly name."); // nobody should care about the friendly name repository.StoreElement(element2, "abcdefg"); Assert.Equal(new[] { element1, element2 }, repository.GetAllElements(), XmlAssert.EqualityComparer); repository.StoreElement(element3, null); Assert.Equal(new[] { element1, element2, element3 }, repository.GetAllElements(), XmlAssert.EqualityComparer); }
public void Store_Then_Get() { // Arrange var element1 = XElement.Parse(@"<element1 />"); var element2 = XElement.Parse(@"<element1 />"); var element3 = XElement.Parse(@"<element1 />"); var repository = new EphemeralXmlRepository(null); // Act & assert repository.StoreElement(element1, "Invalid friendly name."); // nobody should care about the friendly name repository.StoreElement(element2, "abcdefg"); Assert.Equal(new[] { element1, element2 }, repository.GetAllElements(), XmlAssert.EqualityComparer); repository.StoreElement(element3, null); Assert.Equal(new[] { element1, element2, element3 }, repository.GetAllElements(), XmlAssert.EqualityComparer); }
public void GetAllElements_Empty() { // Arrange var repository = new EphemeralXmlRepository(null); // Act & assert Assert.Empty(repository.GetAllElements()); }
public void GetAllElements_Empty() { // Arrange var repository = new EphemeralXmlRepository(null); // Act & assert Assert.Empty(repository.GetAllElements()); }