コード例 #1
0
        protected NBiConstraint InstantiateConstraint(FasterThanXml fasterThanXml)
        {
            var ctr = new FasterThanConstraint();
            ctr = ctr.MaxTimeMilliSeconds(fasterThanXml.MaxTimeMilliSeconds);

            return ctr;
        }
コード例 #2
0
 protected NBiConstraint InstantiateConstraint(FasterThanXml fasterThanXml)
 {
     var ctr = new FasterThanConstraint();
     ctr = ctr.MaxTimeMilliSeconds(fasterThanXml.MaxTimeMilliSeconds);
     //if (fasterThanXml.CleanCache)
     //    ctr = ctr.CleanCache();
     //if (fasterThanXml.TimeOutMilliSeconds > 0)
     //    ctr = ctr.TimeOutMilliSeconds(fasterThanXml.TimeOutMilliSeconds);
     return ctr;
 }
コード例 #3
0
        public void Matches_IsSlowerThanMax_False()
        {
            var stub = new Mock<IExecution>();
            stub.Setup(e => e.Run())
                .Returns(Mock.Of<IExecutionResult>(r => r.TimeElapsed == new TimeSpan(0, 0, 0, 100, 0)));
            var engine = stub.Object;

            var fasterThanConstraint = new FasterThanConstraint();
            fasterThanConstraint = fasterThanConstraint.MaxTimeMilliSeconds(5000);

            Assert.That(fasterThanConstraint.Matches(engine), Is.False);
        }