public void TwoDeserialisedTaskInstanceHaveSameHashCodes() { const string assemblyLocation = "C:\\assembly.dll"; var task1 = new XunitTestAssemblyTask(assemblyLocation); var xmlDocument = new XmlDocument(); var xmlElement = xmlDocument.CreateElement("root"); xmlDocument.AppendChild(xmlElement); task1.SaveXml(xmlDocument.DocumentElement); var task2 = new XunitTestAssemblyTask(xmlDocument.DocumentElement); Assert.NotSame(task1, task2); Assert.Equal(task1.GetHashCode(), task2.GetHashCode()); }
public void CanSerialiseToAndFromXml() { const string assemblyLocation = "C:\\assembly.dll"; var task1 = new XunitTestAssemblyTask(assemblyLocation); var xmlDocument = new XmlDocument(); var xmlElement = xmlDocument.CreateElement("root"); xmlDocument.AppendChild(xmlElement); task1.SaveXml(xmlDocument.DocumentElement); var task2 = new XunitTestAssemblyTask(xmlDocument.DocumentElement); Assert.NotSame(task1, task2); Assert.Equal(task1, task2); }