我正在使用 BsModalRef 来显示模式并使用该content属性发送数据。所以我们有一些这样的:
this.followerService.getFollowers(this.bsModalRef.content.channelId).subscribe((followers) => {
this.followerList = followers;
this.followerList.forEach((follower) => {
follower.avatarLink = this.setUserImage(follower.userId);
this.followerEmails.push(follower.email);
});
});
Run Code Online (Sandbox Code Playgroud)
我们在 bsModalRef ( this.bsModalRef.content.channelId) 的内容中设置 channelId 。它工作正常。现在我正在为此编写单元测试。问题是我无法模拟它。我尝试过覆盖、间谍等,但似乎没有任何效果。我正在使用此链接中提到的方法。一种替代方法是使用 TestBed,但我不太了解它的用途。任何人都可以帮我找到可以实现这一目标的任何方法吗?
unit-testing typescript karma-jasmine ngx-bootstrap angular5
您好,我正在 BCP 查询下方运行以获取数据
exec master.dbo.xp_cmdshell 'bcp "select top 10 ProductFamilyID,ProductSetID,ProductFamilyCode,ProductFamilyName from MPLA.dbo.tblLCFProductFamily" queryout D:\requirement.txt -w -T -S "server_name"'
我通过连接我的 localdb 在 SSMS 2012 上运行它。我也可以访问查询中给出的服务器,但仍然遇到以下错误:
SQLState = 28000, NativeError = 18456
Error = [Microsoft][SQL Server Native Client 11.0][SQL Server]Login failed for user 'FAREAST\D--113062586$'.
NULL
Run Code Online (Sandbox Code Playgroud)
FAREAST\D--113062586$我的 localdb 中甚至不存在提到的用户。如何克服这个问题?
我正在从事 CodedUI 测试自动化项目。我正在开发一个框架,在该框架中我试图VSTS通过RestAPI. 我之前曾开发过一个 MVC 应用程序,在该应用程序中我做了同样的事情来从VSTS使用RestAPI.
现在的问题是我无法访问VSTS. 每次我尝试访问时VSTS,我都会遇到异常TF400813: Resource not available for anonymous access. Client authentication required。
我正在使用相同的PAT token. 我拥有团队项目所需的所有访问权限。我可以从浏览器访问我项目中的所有工作项。我已经尝试了下面线程中提到的所有选项,但仍然无法正常工作。
启动 Visual Studio 2015.3 时出现客户端身份验证错误
任何线索将不胜感激。
以下是我从以下位置获取数据的代码VSTS:
public static List<WorkItem> GetWorkItemsWithSpecificFields(IEnumerable<int> ids)
{
var collectionUri = "https://<name>.visualstudio.com";
var fields = new string[] {
"System.Id",
"System.Title",
"System.WorkItemType",
"Microsoft.VSTS.Scheduling.RemainingWork"
};
using (WorkItemTrackingHttpClient workItemTrackingHttpClient = new WorkItemTrackingHttpClient(new Uri(collectionUri), new VssBasicCredential("", System.Configuration.ConfigurationManager.AppSettings["PATToken"])))
{
// Exception is …Run Code Online (Sandbox Code Playgroud) 我在我的代码中尝试过这些行
DateFormat df = new SimpleDateFormat("dd/MM/yy");
String formattedDate = df.format(new Date());
out.println(formattedDate);
Run Code Online (Sandbox Code Playgroud)
但是 Date() 显示了一些错误,例如没有为 Date() 找到合适的构造函数,并且构造函数 Date.Date(long) 不适用(实际和形式参数列表的长度不同)。我已经搜索了很多,但没有找到任何答案。我只想要一个简单格式的日期。帮助 !!我试着给出一个像
String formattedDate=df.format(new Date(0));
Run Code Online (Sandbox Code Playgroud)
但它显示了一个像 1/1/70 这样的日期。
angular5 ×1
bcp ×1
c# ×1
date ×1
datetime ×1
java ×1
sql-server ×1
ssms-2012 ×1
typescript ×1
unit-testing ×1