~halega/+junk/sharpdevelop

« back to all changes in this revision

Viewing changes to src/AddIns/BackendBindings/Python/PythonBinding/Test/Expressions/RemoveLastPartTests.cs

  • Committer: sk
  • Date: 2011-09-10 05:17:57 UTC
  • Revision ID: halega@halega.com-20110910051757-qfouz1llya9m6boy
4.1.0.7915 Release Candidate 1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
 
2
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
 
3
 
 
4
using System;
 
5
using ICSharpCode.PythonBinding;
 
6
using NUnit.Framework;
 
7
 
 
8
namespace PythonBinding.Tests.Expressions
 
9
{
 
10
        /// <summary>
 
11
        /// Tests the PythonExpressionFinder's RemoveLastPart method.
 
12
        /// </summary>
 
13
        [TestFixture]
 
14
        public class RemoveLastPartTests
 
15
        {
 
16
                PythonExpressionFinder expressionFinder;
 
17
                
 
18
                [TestFixtureSetUp]
 
19
                public void SetUpFixture()
 
20
                {
 
21
                        expressionFinder = new PythonExpressionFinder();
 
22
                }
 
23
                
 
24
                [Test]
 
25
                public void NullString()
 
26
                {
 
27
                        Assert.AreEqual(String.Empty, expressionFinder.RemoveLastPart(null));
 
28
                }
 
29
                
 
30
                [Test]
 
31
                public void EmptyString()
 
32
                {
 
33
                        Assert.AreEqual(String.Empty, expressionFinder.RemoveLastPart(String.Empty));
 
34
                }
 
35
                
 
36
                /// <summary>
 
37
                /// Should remove the WriteLine part of the string.
 
38
                /// </summary>
 
39
                [Test]
 
40
                public void SystemConsoleWriteLineString()
 
41
                {
 
42
                        string expression = "System.Console.WriteLine";
 
43
                        Assert.AreEqual("System.Console", expressionFinder.RemoveLastPart(expression));
 
44
                }
 
45
        }
 
46
}