Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:user visit fix #180

Merged
merged 10 commits into from
Aug 8, 2022
Prev Previous commit
Next Next commit
fix:unit test error
Mayue committed Aug 8, 2022
commit f552cc5ddd9ec037162ea3d832c869cc4dc5f2e7
Original file line number Diff line number Diff line change
@@ -233,8 +233,8 @@ public async Task TestGetCurrentStaffAsync()
}

[TestMethod]
[DataRow("https://www.baidu.com/")]
public async Task TestVisitedAsync(string url)
[DataRow("masa-auth-web-admin", "https://www.baidu.com/")]
public async Task TestVisitedAsync(string appId, string url)
{
var userId = Guid.Parse("A9C8E0DD-1E9C-474D-8FE7-8BA9672D53D1");
var requestUri = $"api/user/visit";
@@ -243,7 +243,7 @@ public async Task TestVisitedAsync(string url)
var userContext = new Mock<IUserContext>();
userContext.Setup(user => user.GetUserId<Guid>()).Returns(userId).Verifiable();
var userService = new UserService(caller.Object, userContext.Object);
await userService.VisitedAsync(url);
await userService.VisitedAsync(appId, url);
caller.Verify(provider => provider.PostAsync<object>(requestUri, It.IsAny<object>(), true, default), Times.Once);
}