public static void AssertTargetNotExecuted(this BuildLog log, string targetName)
        {
            var found = log.Targets.FirstOrDefault(t => t.Equals(targetName, StringComparison.InvariantCulture));

            found.Should().BeNull("Not expecting the target to have been executed: {0}", targetName);
        }
        public static void AssertTaskExecuted(this BuildLog log, string taskName)
        {
            var found = log.Tasks.FirstOrDefault(t => t.Equals(taskName, StringComparison.InvariantCulture));

            found.Should().NotBeNull("Specified task was not executed: {0}", taskName);
        }
 public static void AssertExpectedItemGroupCount(this BuildLog log, string itemName, int expectedCount)
 {
     log.CapturedItemValues.Count(p => p.Name.Equals(itemName, System.StringComparison.OrdinalIgnoreCase))
     .Should().Be(expectedCount);
 }
 /// <summary>
 /// Checks that building the specified target failed.
 /// </summary>
 public static void AssertTargetFailed(this BuildLog log, string target)
 {
     AssertTargetExecuted(log, target);
     log.BuildSucceeded.Should().BeFalse();
 }
 public static IEnumerable <BuildItem> GetCapturedItemValues(this BuildLog log, string itemName)
 {
     return(log.CapturedItemValues.Where(
                p => p.Name.Equals(itemName, System.StringComparison.OrdinalIgnoreCase)).ToList());
 }
        public static void AssertExpectedCapturedPropertyValue(this BuildLog log, string propertyName, string expectedValue)
        {
            var capturedValue = GetCapturedPropertyValue(log, propertyName);

            capturedValue.Should().Be(expectedValue, "Captured property '{0}' does not have the expected value", propertyName);
        }
 public static void AssertExpectedWarningCount(this BuildLog log, int expected)
 {
     log.Warnings.Should().HaveCount(expected);
 }
 public static void AssertExpectedErrorCount(this BuildLog log, int expected)
 {
     log.Errors.Should().HaveCount(expected);
 }
 public static void AssertNoWarningsOrErrors(this BuildLog log)
 {
     AssertExpectedErrorCount(log, 0);
     AssertExpectedWarningCount(log, 0);
 }