コード例 #1
0
    public void Select_returns_last_service_for_language()
    {
        var expected = new TestModelCodeGenerator("C#");
        var selector = new ModelCodeGeneratorSelector(
            new[]
        {
            new TestModelCodeGenerator("C#"),
            expected
        });

        var result = selector.Select(
            new ModelCodeGenerationOptions
        {
            Language = "C#"
        });

        Assert.Same(expected, result);
    }
コード例 #2
0
    public void Select_returns_last_service_for_language_when_no_templates()
    {
        var expected = new TestModelCodeGenerator("C#");
        var selector = new ModelCodeGeneratorSelector(
            new IModelCodeGenerator[]
        {
            new TestTemplatedModelGenerator(hasTemplates: false),
            new TestModelCodeGenerator("C#"),
            expected
        });

        var result = selector.Select(
            new ModelCodeGenerationOptions
        {
            Language = "C#"
        });

        Assert.Same(expected, result);
    }