Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

56 lines
1.7 KiB
C#

// Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
using System.Web.Razor.Generator;
using System.Web.Razor.Parser;
using Microsoft.VisualBasic;
using Xunit;
namespace System.Web.Razor.Test
{
public class VBRazorCodeLanguageTest
{
[Fact]
public void CreateCodeParserReturnsNewVBCodeParser()
{
// Arrange
RazorCodeLanguage service = new VBRazorCodeLanguage();
// Act
ParserBase parser = service.CreateCodeParser();
// Assert
Assert.NotNull(parser);
Assert.IsType<VBCodeParser>(parser);
}
[Fact]
public void CreateCodeGeneratorParserListenerReturnsNewCSharpCodeGeneratorParserListener()
{
// Arrange
RazorCodeLanguage service = new VBRazorCodeLanguage();
// Act
RazorEngineHost host = new RazorEngineHost(new VBRazorCodeLanguage());
RazorCodeGenerator generator = service.CreateCodeGenerator("Foo", "Bar", "Baz", host);
// Assert
Assert.NotNull(generator);
Assert.IsType<VBRazorCodeGenerator>(generator);
Assert.Equal("Foo", generator.ClassName);
Assert.Equal("Bar", generator.RootNamespaceName);
Assert.Equal("Baz", generator.SourceFileName);
Assert.Same(host, generator.Host);
}
[Fact]
public void CodeDomProviderTypeReturnsVBCodeProvider()
{
// Arrange
RazorCodeLanguage service = new VBRazorCodeLanguage();
// Assert
Assert.Equal(typeof(VBCodeProvider), service.CodeDomProviderType);
}
}
}