mirror of
https://github.com/FabInfra/capnproto-dotnetcore_Runtime.git
synced 2025-03-12 14:51:41 +01:00
42 lines
1.2 KiB
C#
42 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
namespace Capnpc.Csharp.MsBuild.Generation
|
|
{
|
|
public class TestFileGeneratorResult
|
|
{
|
|
public TestFileGeneratorResult(TestGeneratorResult generatorResult, string fileName)
|
|
{
|
|
if (generatorResult == null)
|
|
{
|
|
throw new ArgumentNullException(nameof(generatorResult));
|
|
}
|
|
|
|
Filename = fileName ?? throw new ArgumentNullException(nameof(fileName));
|
|
|
|
Errors = generatorResult.Errors;
|
|
IsUpToDate = generatorResult.IsUpToDate;
|
|
GeneratedTestCode = generatorResult.GeneratedTestCode;
|
|
}
|
|
|
|
/// <summary>
|
|
/// The errors, if any.
|
|
/// </summary>
|
|
public IEnumerable<TestGenerationError> Errors { get; }
|
|
|
|
/// <summary>
|
|
/// The generated file was up-to-date.
|
|
/// </summary>
|
|
public bool IsUpToDate { get; }
|
|
|
|
/// <summary>
|
|
/// The generated test code.
|
|
/// </summary>
|
|
public string GeneratedTestCode { get; }
|
|
|
|
public bool Success => Errors == null || !Errors.Any();
|
|
|
|
public string Filename { get; }
|
|
}
|
|
} |