.NET Decompiler with support for PDB generation, ReadyToRun, Metadata (&more) - cross-platform!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

36 lines
1.3 KiB

// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using NUnit.Framework;
namespace ICSharpCode.AvalonEdit.Utils
{
[TestFixture]
public class IndentationStringTests
{
[Test]
public void IndentWithSingleTab()
{
var options = new TextEditorOptions { IndentationSize = 4, ConvertTabsToSpaces = false };
Assert.AreEqual("\t", options.IndentationString);
Assert.AreEqual("\t", options.GetIndentationString(2));
Assert.AreEqual("\t", options.GetIndentationString(3));
Assert.AreEqual("\t", options.GetIndentationString(4));
Assert.AreEqual("\t", options.GetIndentationString(5));
Assert.AreEqual("\t", options.GetIndentationString(6));
}
[Test]
public void IndentWith4Spaces()
{
var options = new TextEditorOptions { IndentationSize = 4, ConvertTabsToSpaces = true };
Assert.AreEqual(" ", options.IndentationString);
Assert.AreEqual(" ", options.GetIndentationString(2));
Assert.AreEqual(" ", options.GetIndentationString(3));
Assert.AreEqual(" ", options.GetIndentationString(4));
Assert.AreEqual(" ", options.GetIndentationString(5));
Assert.AreEqual(" ", options.GetIndentationString(6));
}
}
}