public TextEditorForm() { InitializeComponent(); _config = new TextEditorConfiguration(); makeClearView(); _config.prepareTextView(textView); _editor = new MP3Editor(); hideIpodButtons(); }
public void calibrateTextViewTest() { RichTextBox textBox = new RichTextBox(); int expected = textBox.SelectionStart; TextEditorConfiguration config = new TextEditorConfiguration(); config.calibrateTextView(textBox); Assert.AreEqual(9, textBox.SelectionIndent, "prepareTextView method does not work correctly. SelectionIndent is not correct"); Assert.AreEqual(9, textBox.SelectionRightIndent, "prepareTextView method does not work correctly. SelectionRightIndent is not correct"); Assert.AreEqual(0, textBox.SelectionLength, "prepareTextView method does not work correctly. SelectionLength is not correct"); Assert.AreEqual(expected, textBox.SelectionStart, "prepareTextView method does not work correctly. SelectionStart is not correct"); }
public void prepareTextViewTest() { RichTextBox textBox = new RichTextBox(); TextEditorConfiguration config = new TextEditorConfiguration(); float currSize = textBox.Font.Size; float textConst = 0.89F; int ipodLineSymbolsCount = 27; int textViewLineSymbolsCount = 39; float fontSize = ((textViewLineSymbolsCount * currSize) / ipodLineSymbolsCount) * textConst; config.prepareTextView(textBox); Assert.AreEqual(9, textBox.SelectionIndent, "prepareTextView method does not work correctly. SelectionIndent is not correct"); Assert.AreEqual(9, textBox.SelectionRightIndent, "prepareTextView method does not work correctly. SelectionRightIndent is not correct"); Assert.AreEqual(0, textBox.SelectionLength, "prepareTextView method does not work correctly. SelectionLength is not correct"); Assert.AreEqual(fontSize, textBox.Font.Size, "prepareTextView method does not work correctly. Font size is not correct"); }