我有一个我们正在建设的移动网站.它将是一个单页网站,使用AngularJS作为MVC部分.我们需要插入WebTrends跟踪.然而,因为它是一个仅使用JS来更改UI的单个页面,所以我不知道如何告诉/触发WebTrends知道新页面并已呈现以及新页面是什么.
谁知道?
好的,我很难解决如何为采用表达式的方法设置最小起订量的问题。有很多关于如何实现它的示例。IsAny <> ...这不是我所追求的。我在处理约束之后,所以是It.Is <>。我已经设置了它,但是它从不返回我要求它返回的值。
// Expression being setup
Expression<Func<UserBinding, bool>> testExpression = binding =>
binding.User.Username == "Testing Framework";
// Setup of what expression to look for.
this.bindingManager.Setup(
c => c.GetUserBinding(It.Is<Expression<Func<UserBinding, bool>>>
(criteria => criteria == testExpression)))
.Returns(new List<UserBinding>() { testBinding }.AsQueryable());
// Line of code call from within the class being tested. So this is being mocked and should return the defined object when the same lambda is passed in.
this.bindingManager.GetUserBinding(b => b.User.Username == username)
.SingleOrDefault();
// class under test. …Run Code Online (Sandbox Code Playgroud)