我希望我的基于基于NUnit框架的单元测试在Visual Studio测试资源管理器中更具可读性。
例如,最好使用类似的东西(通过从属性中分配值)代替Test_Case_1或TestCase1拥有,但方法名称中不允许使用空格和字符。Test Case #1, Category: First, Category: Second[Category]
我知道它在中可能是开箱即用的xUnit,但是我不能涉及它,因为我正在使用无法使用xUnit框架实现的自定义项。
是否可以用重写单元测试的显示名称NUnit?到目前为止,我可以看到,该FullName字段TestDetail具有私有设置程序。
是否有其他方法或方法更改NUnit测试的显示名称?
我正在尝试为已经存在的库创建类型定义,并且有问题正确描述其结构。问题是嵌套的命名空间。在 JavaScript 中,我的方法的全名如下所示:
NameSpace1.NameSpace2.NameSpace3.MethodName()
Run Code Online (Sandbox Code Playgroud)
但我无法创建正确的d.ts定义文件...我尝试了不同的组合,其中export interface,export module用于嵌套命名空间...但没有任何效果。唯一不会引发任何错误的结构如下:
declare namespace NameSpace1 {
}
Run Code Online (Sandbox Code Playgroud)
但这还不够……你知道如何在 TypeScript 定义中正确描述这样的嵌套命名空间吗?
我有一个JSON字符串:
{"responseData":
{"results": [
{"GsearchResultClass": "GblogSearch",
"title":"\u003cb\u003eParis Hilton\u003c/b\u003e shops at Sydney Michelle boutique in the Beverly Glen \u003cb\u003e...\u003c/b\u003e",
"titleNoFormatting":"Paris Hilton shops at Sydney Michelle boutique in the Beverly Glen ...",
"postUrl":"http://www.celebrity-gossip.net/celebrities/hollywood/paris-hilton-sydney-michelle-stockup-215844/",
"content":"\u003cb\u003eParis Hilton\u003c/b\u003e shops at Sydney Michelle boutique in the Beverly Glen Mall - \u003cb\u003eParis Hilton\u003c/b\u003e: Sydney Michelle Stockup.",
"author":"The Gossip Girls at (c) gossipgirls.com",
"blogUrl":"http://www.celebrity-gossip.net/",
"publishedDate":"Tue, 23 Feb 2010 22:26:00 -0800"
},
{"GsearchResultClass":"GblogSearch",
"title":"\u003cb\u003eParis Hilton\u003c/b\u003e having wardrobe woes as she met with her lawyer",
"titleNoFormatting":"Paris Hilton having wardrobe woes …Run Code Online (Sandbox Code Playgroud) 我试图通过数据库中的产品上的CRM Web服务将"StatE代码"(Active | Inactive)更新为Active.
...
crmProduct.statecode = new ProductStateInfo() { Value = ProductState.Active };
//crmProduct.statuscode = new Status() { Value = 1 };
crmProduct.name = "...";
service.Update(crmProduct);
Run Code Online (Sandbox Code Playgroud)
它似乎工作正常,我没有错误和名称更改,但它仍然无效!
当试图将"StatUS代码"设置为"活动"时,我收到一条错误,指出当状态为"无效"时我无法将状态设置为"活动"...但我同时将两者都设置为"活动"...嗯...现在不是什么意思错了......
有线索吗?
CRM 2011使用ADFS和HTTPS进行设置.我正在尝试从自定义网页连接到organization.svc,该网页与CRM 2011位于同一个IIS上,但使用此代码作为不同的网站:
OrganizationServiceProxy serviceProxy;
ClientCredentials clientCredentials = new ClientCredentials();
clientCredentials.UserName.UserName = "admin";
clientCredentials.UserName.Password = "pass";
Guid contactId = Guid.Empty;
Uri OrganizationUri = new Uri(String.Format("https://organization.crmdev.com:port/XRMServices/2011/Organization.svc"));
Uri HomeRealmUri = new Uri(String.Format("https://organization.crmdev.com:port/XRMServices/2011/Discovery.svc"));
using (serviceProxy = new OrganizationServiceProxy(OrganizationUri, null, clientCredentials, null))
{
serviceProxy.ServiceConfiguration.CurrentServiceEndpoint.Behaviors.Add(new ProxyTypesBehavior());
IOrganizationService service = (IOrganizationService)serviceProxy;
Entity contact = new Entity("contact");
contact.Attributes["lastname"] = "oi oi";
contactId = service.Create(contact);
}
Run Code Online (Sandbox Code Playgroud)
它返回错误消息:
从另一方收到了无担保或不正确安全的故障.请参阅内部FaultException以获取故障代码和详细信息.ID3242:无法对安全令牌进行身份验证或授权.
并在事件查看器中我看到错误:
Account For Which Logon Failed:
Security ID: NULL SID
Account Name: admin
Account Domain:
Failure Reason: Unknown user name …Run Code Online (Sandbox Code Playgroud) 是否可以在不触发异常的情况下停止执行MS CRM插件?
我想禁止用户操作,因此创建了插件列表Pre事件步骤。我计划取消该Pre步骤之后的所有其他操作。
我怎样才能做到这一点?当然,不显示错误消息。
如何使用C#更改CRM 2013中实体的状态和/或状态?
CRM 2011的SetStateRequest和早期的SetStateDynamicEntityRequest都没有得到识别.在线搜索似乎也没有帮助...我错过了命名空间或什么?
提前致谢
命名空间:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Client;
using Microsoft.Xrm.Sdk.Query;
using Microsoft.Xrm.Sdk.Discovery;
using Microsoft.Xrm.Sdk.Messages;
using System.ServiceModel;
using System.ServiceModel.Description;
using System.Web.Services.Protocols;
Run Code Online (Sandbox Code Playgroud)
功能:
private void changeUserStatus(Guid userId, IOrganizationService service, int state)
{
SetStateRequest setStateRequest = new SetStateRequest
{
EntityMoniker = new EntityReference("systemuser", userId),
State = new OptionSetValue(state),
Status = new OptionSetValue(-1),
};
service.Execute(setStateRequest);
}
Run Code Online (Sandbox Code Playgroud)
重要提示:我的SetStateRequest不被visual studio 2012识别,因此与上面的示例不同,它没有突出显示,实际上是红色下划线,并且在悬停时显示"未找到类型或命名空间"消息
编辑:我看到问题得到了投票,我很抱歉,如果我错过了一些东西,但我真的没有更多的信息提供,除了我昨天花了4个小时在线寻找这个(包括stackoverflow)没有任何无济于事.我可能使用了错误的搜索条件或查找错误的地方,但如果是这样的话,任何人都可以至少指出我正确的方向吗?我是所有这些的初学者(stackoverflow和crm2013),我有点坚持这个.再次感谢
我正在尝试在 Golang 中编写通用函数,该函数将以类似的方式在切片和通道中搜索值。这是一个例子:
// MinOf returns the smallest number found among the channel / slice contents
func MinOf[T chan int | []int](input T) (result int) {
for _, value := range input {
if result > value {
result = value
}
}
return
}
Run Code Online (Sandbox Code Playgroud)
但我收到以下编译错误:cannot range over input (variable of type T constrained by chan int|[]int) (T has no core type)。
我尝试创建通用接口,如下所示:
type Rangable interface {
chan int | []int
}
// MinOf returns the smallest number …Run Code Online (Sandbox Code Playgroud) 我想知道的区别是托管解决方案和非托管解决方案的CRM 5.0(2011)?
我试图在自定义工作流活动中使用optionset输入参数,所以我使用了以下代码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
using System.Activities;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Workflow;
using Microsoft.Xrm.Sdk.Query;
using System.Globalization;
namespace ITWorx.VisitManagement.Workflows
{
public class FormatDate : CodeActivity
{
[Input("Preferred Language")]
[AttributeTarget("contact", "itworx_preferredlanguage")]
[Default("894330000")]
public InArgument<OptionSetValue> PreferredLanguage { get; set; }
protected override void Execute(CodeActivityContext context)
{
IWorkflowContext workflowContext = context.GetExtension<IWorkflowContext>();
IOrganizationServiceFactory serviceFactory = context.GetExtension<IOrganizationServiceFactory>();
IOrganizationService service = serviceFactory.CreateOrganizationService(workflowContext.UserId);
int preferredLanguage = PreferredLanguage.Get<OptionSetValue>(context).Value;
}
}
}
Run Code Online (Sandbox Code Playgroud)
但是在下面的行中抛出了一个异常:
int preferredLanguage = PreferredLanguage.Get<OptionSetValue>(context).Value;
Run Code Online (Sandbox Code Playgroud)
异常:NullReferenceException {"对象引用未设置为对象的实例."}
请指教
表格:实体A.
表格:实体B.
功能: 当我在实体中选择审批人时:A并选择一个html按钮我使用下面的代码将查询字符串发送到表单实体:B
<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD>
<SCRIPT type=text/javascript>
function setDelegate(){
var ApproverInfo = new Array();
ApproverInfo = window.parent.Xrm.Page.getAttribute('bch_approver').getValue();
if(ApproverInfo[0] != null)
{
var parameters = {};
parameters["formid"] = "{b053a39a-041a-4356-acef-ddf00182762b}";
window.parent.Xrm.Utility.openEntityForm("bch_delegate", ApproverInfoId );
}
}
</SCRIPT>
<META charset=utf-8></HEAD>
<BODY><INPUT onclick=setDelegate(); value="Set Delegate" type=submit> </BODY></HTML>
Run Code Online (Sandbox Code Playgroud)
在表单实体:B页面加载我写了以下javascript代码来读取和设置实体中的查找:B
我已经使用以下代码收到了查询字符串:
// Get the Value of the Regarding through the Customer Parameters
var param=Xrm.Page.context.getQueryStringParameters();
if (param != null ) {
alert('inside');
var ApproverId=param["bch_signingauthority"];
var bchName …Run Code Online (Sandbox Code Playgroud) javascript crm dynamics-crm dynamics-crm-2011 dynamics-crm-2013
c# ×4
dynamics-crm ×4
crm ×3
javascript ×3
.net ×2
credentials ×1
discovery ×1
generics ×1
go ×1
json ×1
json.net ×1
nunit ×1
parsing ×1
service ×1
typescript ×1
unit-testing ×1