我有一个魔鬼的时间让这个工作......
下面是我们的 Web 服务使用的复杂类型的示例。传递的其他重载/参数是原语、日期时间等。我有一些单元测试方法,它们对我在签入新代码时运行的对象进行一对一的比较,并且那些通过就好了。我现在需要做的是实现(可能是一个类?)捕获传递的 XML 的东西是响应,因此我可以将它与请求中发送的内容进行比较。此外,我需要建立更改我传递的数据的能力(以测试负面案例/不良数据),而我完全不知道这样做。任何和所有帮助将不胜感激,我很乐意应要求提供更多代码。
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
[System.Runtime.Serialization.DataContractAttribute(Name="CrossReferenceCredentials", Namespace="http://www.pse.com/Namespaces/PSE.PSECom.InterfaceWebServices.Customer")]
[System.SerializableAttribute()]
public partial class CrossReferenceCredentials : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged {
[System.NonSerializedAttribute()]
private System.Runtime.Serialization.ExtensionDataObject extensionDataField;
private string CustomerTokenField;
private string SecurityIdField;
private string UserNameField;
[global::System.ComponentModel.BrowsableAttribute(false)]
public System.Runtime.Serialization.ExtensionDataObject ExtensionData {
get {
return this.extensionDataField;
}
set {
this.extensionDataField = value;
}
}
[System.Runtime.Serialization.DataMemberAttribute(IsRequired=true)]
public string CustomerToken {
get {
return this.CustomerTokenField;
}
set {
if ((object.ReferenceEquals(this.CustomerTokenField, value) != true)) {
this.CustomerTokenField = value;
this.RaisePropertyChanged("CustomerToken");
}
}
}
[System.Runtime.Serialization.DataMemberAttribute(IsRequired=true)]
public string SecurityId {
get {
return this.SecurityIdField;
}
set {
if ((object.ReferenceEquals(this.SecurityIdField, value) != true)) {
this.SecurityIdField = value;
this.RaisePropertyChanged("SecurityId");
}
}
}
[System.Runtime.Serialization.DataMemberAttribute(IsRequired=true)]
public string UserName {
get {
return this.UserNameField;
}
set {
if ((object.ReferenceEquals(this.UserNameField, value) != true)) {
this.UserNameField = value;
this.RaisePropertyChanged("UserName");
}
}
}
public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
protected void RaisePropertyChanged(string propertyName) {
System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
if ((propertyChanged != null)) {
propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
}
}
}