protected NBiConstraint InstantiateConstraint(FasterThanXml fasterThanXml)
        {
            var ctr = new FasterThanConstraint();
            ctr = ctr.MaxTimeMilliSeconds(fasterThanXml.MaxTimeMilliSeconds);

            return ctr;
        }
 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;
 }
        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);
        }