Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests to validate the generated files #89

Open
marknfawaz opened this issue Mar 24, 2021 · 1 comment
Open

Add tests to validate the generated files #89

marknfawaz opened this issue Mar 24, 2021 · 1 comment

Comments

@marknfawaz
Copy link
Contributor

Description

We need to add tests to validate the porting report and (if possible) log files.

@jonlouie
Copy link
Contributor

jonlouie commented Mar 24, 2021

A proxy test we could use to validate our log files is to validate the method calls used by our logger. For example, if we expect 0 errors in a porting test, we can assert that ILogger.LogError() was called zero times. Given the isolated and predictable nature of our tests, I think this is a fair and viable assertion.

Should we go this route, here is a partial example of how we could approach it:

using moq;

Mock<ILogger> _mockLogger;

[SetUp]
public void SetUp()
{
    _mockLogger = new Mock<ILogger>();
}

[Test]
public void PortingAnalysisShouldLogZeroErrors()
{
    var solutionPort = new SolutionPort(path, config, _mockLogger);
    solutionPort.AnalysisRun();

    _mockLogger.Verify(l => l.LogError(), Times.Zero());
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants