aspnetcore/test/Microsoft.AspNet.Razor.Test/SourceLocationTest.cs

23 lines
640 B
C#

// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Xunit;
namespace Microsoft.AspNet.Razor
{
public class SourceLocationTest
{
[Fact]
public void ConstructorWithLineAndCharacterIndexSetsAssociatedProperties()
{
// Act
var loc = new SourceLocation(0, 42, 24);
// Assert
Assert.Equal(0, loc.AbsoluteIndex);
Assert.Equal(42, loc.LineIndex);
Assert.Equal(24, loc.CharacterIndex);
}
}
}