示例#1
0
        private static List <LogKeyValueItem> GenerateTestHandlers(DomainProjectOptions domainProjectOptions, List <SyntaxGeneratorHandler> sgHandlers)
        {
            if (domainProjectOptions == null)
            {
                throw new ArgumentNullException(nameof(domainProjectOptions));
            }

            if (sgHandlers == null)
            {
                throw new ArgumentNullException(nameof(sgHandlers));
            }

            var logItems = new List <LogKeyValueItem>();

            if (domainProjectOptions.PathForTestHandlers != null)
            {
                foreach (var sgHandler in sgHandlers)
                {
                    logItems.Add(GenerateServerDomainXunitTestHelper.GenerateGeneratedTests(domainProjectOptions, sgHandler));
                    logItems.Add(GenerateServerDomainXunitTestHelper.GenerateCustomTests(domainProjectOptions, sgHandler));
                }
            }

            return(logItems);
        }
    private void GenerateTestHandlers(
        DomainProjectOptions domainProjectOptions,
        List <SyntaxGeneratorHandler> sgHandlers)
    {
        ArgumentNullException.ThrowIfNull(domainProjectOptions);
        ArgumentNullException.ThrowIfNull(sgHandlers);

        if (domainProjectOptions.PathForTestHandlers is not null)
        {
            foreach (var sgHandler in sgHandlers)
            {
                GenerateServerDomainXunitTestHelper.GenerateGeneratedTests(logger, domainProjectOptions, sgHandler);
                GenerateServerDomainXunitTestHelper.GenerateCustomTests(logger, domainProjectOptions, sgHandler);
            }
        }
    }