使用 NUnit 中的 Facebook C# SDK
是否有任何代码示例可以允许 Facebook SDK 进行身份验证并能够获取点赞和其他数据?我的想法是,我希望有一个单元测试与持续集成的环境一起运行。我不想使用浏览器来完成此操作。我想也许是不可能的。
Are there any code samples that work that allow the Facebook SDK to authenticate and to be able to get likes and other data? Idea being that, I'd like to have a unit test to run in conjunction with a continously integrated environment. I don't want to have to use a browser to do it. Might not be possible, I guess.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在这种情况下,您将希望避免测试这种依赖关系......正如您所建议的,当工作流程中存在浏览器/用户时,测试变得非常困难。因此,您希望将其从可测试逻辑中正确抽象出来,并简单地使用模拟对象
this is a case where you will want to avoid testing this dependency ... as you suggest, it becomes far too difficult to test when there's a browser/user in the workflow. So you want to properly abstract this away from your testable logic, and simply use a mock object