本文整理汇总了C#中Destination.CreateCase方法的典型用法代码示例。如果您正苦于以下问题:C# Destination.CreateCase方法的具体用法?C# Destination.CreateCase怎么用?C# Destination.CreateCase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Destination
的用法示例。
在下文中一共展示了Destination.CreateCase方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CanCreateAndGetCase
public void CanCreateAndGetCase()
{
var caseData = new Integrator.CaseData
{
Id = 10,
CaseManagerEmail = DefaultUser.Email,
ClaimantContact = new Integrator.CaseData.ContactData
{
Name = "name",
EMail = "[email protected]",
Address = "address",
Phone = "+375297775218",
},
StartDate = DateTime.Now,
};
var destination = new Destination(ConfigurationManager.AppSettings["WebApiUrl"]);
destination.CreateCase(caseData);
var client = DefaultUser.CreateWebApiClient();
var login = DefaultUser.Login();
var readCase = client.GetCase(login.SecurityToken, caseData.Id);
Assert.IsNotNull(readCase);
Assert.AreEqual(Server.Contract.Cases.CaseStateKind.New, readCase.ReadonlyData.State.StateKind);
Assert.AreEqual(caseData.Id, readCase.ReadonlyData.Id);
Assert.AreEqual(caseData.ClaimantContact.EMail, readCase.Contacts.ClaimantContact.EMail);
Assert.AreEqual(caseData.ClaimantContact.Address, readCase.Contacts.ClaimantContact.Address);
Assert.AreEqual(caseData.ClaimantContact.Name, readCase.Contacts.ClaimantContact.Name);
Assert.AreEqual(caseData.ClaimantContact.Phone, readCase.Contacts.ClaimantContact.Phone);
Assert.IsNull(readCase.Contacts.ArchitectContact.Name);
Assert.IsNull(readCase.Contacts.ArchitectContact.Address);
Assert.IsNull(readCase.Contacts.ArchitectContact.EMail);
Assert.IsNull(readCase.Contacts.ArchitectContact.Phone);
Assert.IsNull(readCase.Contacts.ArchitectContact.RegistrationNumber);
Assert.IsNull(readCase.InitialData.Background);
Assert.IsNull(readCase.Contacts.Relationship);
Assert.IsNull(readCase.InitialData.IdealOutcome);
Assert.IsNull(readCase.Contacts.ContactAgreement);
Assert.AreEqual(0, readCase.Allegations.Items.Length);
Assert.AreEqual(0, readCase.DatesAndDetails.Length);
}
示例2: CreateCase
private static Integrator.CaseData CreateCase(int id)
{
var caseData = new Integrator.CaseData
{
Id = id,
CaseManagerEmail = DefaultUser.Email,
ClaimantContact = new Integrator.CaseData.ContactData
{
Name = "name",
EMail = "[email protected]",
Address = "address",
Phone = "+375297775218",
},
StartDate = DateTime.Now,
};
var destination = new Destination(ConfigurationManager.AppSettings["WebApiUrl"]);
destination.CreateCase(caseData);
return caseData;
}
示例3: CanAddPreliminaryDecisionDocument
public void CanAddPreliminaryDecisionDocument()
{
var caseData = new Integrator.CaseData
{
Id = 10,
CaseManagerEmail = DefaultUser.Email,
ClaimantContact = new Integrator.CaseData.ContactData
{
Name = "name",
EMail = "[email protected]",
Address = "address",
Phone = "+375297775218",
},
StartDate = DateTime.Now,
};
var destination = new Destination(ConfigurationManager.AppSettings["WebApiUrl"]);
destination.CreateCase(caseData);
var caseWorker = Database.CreateActiveUser("[email protected]", Role.CaseWorker);
var caseWorkerToken = UserManagementTests.Login(caseWorker.Email, Database.Password, Database.Phrase).SecurityToken;
var client = DefaultUser.CreateWebApiClient();
client.AddPreliminaryDecision(caseWorkerToken, caseData.Id,
new NewDocument {Id = Guid.NewGuid(), Name = "document", Body = new byte[] {1, 2, 3}});
var documents = client.GetCaseDocuments(caseWorkerToken, caseData.Id);
var @case = client.GetCase(caseWorkerToken, caseData.Id);
Assert.AreEqual(1, documents.Length);
Assert.AreEqual("document", documents[0].Name);
Assert.AreEqual("document", @case.PreliminaryDecisionDocument.Name);
var doc = client.GetDocument(caseWorkerToken, documents[0].Id);
Console.WriteLine(doc.Body.Length);
}
示例4: CanAddAndGetPartiesComments
public void CanAddAndGetPartiesComments()
{
var caseData = new Integrator.CaseData
{
Id = 10,
CaseManagerEmail = DefaultUser.Email,
ClaimantContact = new Integrator.CaseData.ContactData
{
Name = "name",
EMail = "[email protected]",
Address = "address",
Phone = "+375297775218",
},
StartDate = DateTime.Now,
};
var destination = new Destination(ConfigurationManager.AppSettings["WebApiUrl"]);
destination.CreateCase(caseData);
var caseWorker = Database.CreateActiveUser("[email protected]", Role.CaseWorker);
var caseWorkerToken = UserManagementTests.Login(caseWorker.Email, Database.Password, Database.Phrase).SecurityToken;
var client = DefaultUser.CreateWebApiClient();
client.AddPartiesComment(caseWorkerToken, caseData.Id, "supertext", new NewDocument[]
{
new NewDocument
{
Id = Guid.NewGuid(),
Name = "document1",
Body = new byte[] {1, 2, 3, 4, 5},
},
new NewDocument
{
Id = Guid.NewGuid(),
Name = "document2",
Body = new byte[] {6, 7, 8, 9, 10},
}
});
var login = DefaultUser.Login();
var readCase = client.GetCase(login.SecurityToken, caseData.Id);
Assert.AreEqual(1, readCase.PartiesComments.Length);
Assert.AreEqual("supertext", readCase.PartiesComments[0].Text);
Assert.AreEqual(2, readCase.PartiesComments[0].Documents.Length);
var documentNames = readCase.PartiesComments[0].Documents.Select(x => x.Name).OrderBy(x => x).ToArray();
Assert.AreEqual("document1", documentNames[0]);
Assert.AreEqual("document2", documentNames[1]);
}