public void WriteElementExtensions_Invoke_ReturnsExpected(string version) { var workspace = new WorkspaceSubclass(); CompareHelper.AssertEqualWriteOutput("", writer => workspace.WriteElementExtensionsEntryPoint(writer, version)); workspace.ElementExtensions.Add(new ExtensionObject { Value = 10 }); workspace.ElementExtensions.Add(new ExtensionObject { Value = 11 }); CompareHelper.AssertEqualWriteOutput( @"<WorkspaceTests.ExtensionObject xmlns:i=""http://www.w3.org/2001/XMLSchema-instance"" xmlns=""http://schemas.datacontract.org/2004/07/System.ServiceModel.Syndication.Tests""> <Value>10</Value> </WorkspaceTests.ExtensionObject> <WorkspaceTests.ExtensionObject xmlns:i=""http://www.w3.org/2001/XMLSchema-instance"" xmlns=""http://schemas.datacontract.org/2004/07/System.ServiceModel.Syndication.Tests""> <Value>11</Value> </WorkspaceTests.ExtensionObject>", writer => workspace.WriteElementExtensionsEntryPoint(writer, version)); }
public void WriteElementExtensions_NullWriter_ThrowsArgumentNullException() { var workspace = new WorkspaceSubclass(); AssertExtensions.Throws <ArgumentNullException>("writer", () => workspace.WriteElementExtensionsEntryPoint(null, "version")); }