Exemplo n.º 1
0
 public void ValidateChecksNameIsSet()
 {
     var condition = new FileExists();
     var validationMock = new Mock<IValidationLog>(MockBehavior.Strict);
     validationMock.Setup(vl => vl.AddError("FileName has not been set")).Verifiable();
     condition.Validate(validationMock.Object);
     validationMock.Verify();
 }
Exemplo n.º 2
0
 public void EvaluateReturnsResultOfFileCheck()
 {
     var fileSystemMock = new Mock<IFileSystem>(MockBehavior.Strict);
     fileSystemMock.Setup(fs => fs.CheckIfFileExists("c:\\test.xml")).Returns(true);
     var condition = new FileExists
                         {
                             FileName = "c:\\test.xml",
                             FileSystem = fileSystemMock.Object
                         };
     var contextMock = new Mock<TaskExecutionContext>(new TaskExecutionParameters());
     var result = condition.Evaluate(contextMock.Object);
     Assert.IsTrue(result);
 }