我有一段时间可以开始工作......
下面是我们的Web服务使用的复杂类型的示例。传递的其他重载/参数是基元,DateTime等。我有一些单元测试方法,它们对我在新代码签入时运行的对象进行一对一的比较,并且传递得很好。我现在需要做的是实现(一个类,也许?),捕获传递的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));
}
}
}
答案 0 :(得分:1)
我能够回答我自己的问题,实际上最终走的是完全不同的路线。我们购买了完整版的SoapUI,并用它来完成我们的大部分功能和单元测试。