コード例 #1
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;
 }
コード例 #2
0
 protected global::NUnit.Framework.Constraints.Constraint 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_SlowerThanMaxTimeAndTimeOut_Failure()
        {
            var command = new SqlCommand();
            command.Connection = new SqlConnection(ConnectionStringReader.GetSqlClient());
            command.CommandText = "WAITFOR DELAY '00:00:10';";

            var ctr = new FasterThanConstraint();
            ctr = ctr.MaxTimeMilliSeconds(100);
            ctr = ctr.TimeOutMilliSeconds(1000);

            //Method under test
            Assert.That(ctr.Matches(command), Is.False);
        }
コード例 #4
0
        public void Matches_FasterThanMaxTime_Success()
        {
            var command = new SqlCommand();
            command.Connection=new SqlConnection(ConnectionStringReader.GetSqlClient());
            command.CommandText = "WAITFOR DELAY '00:00:00';";

            var ctr = new FasterThanConstraint();
            ctr = ctr.MaxTimeMilliSeconds(1000);
            ctr = ctr.TimeOutMilliSeconds(2000);

            //Method under test
            Assert.That(command, ctr);
        }
コード例 #5
0
ファイル: Is.cs プロジェクト: Waltervondehans/NBi
 public static FasterThanConstraint FasterThan(int maxTimeMilliSeconds)
 {
     var ctr = new FasterThanConstraint();
     ctr.MaxTimeMilliSeconds(maxTimeMilliSeconds);
     return ctr;
 }