Refactored the Kernel registration fluent interface to be more readable, better suppo...
[castle.git] / Experiments / SubversionHooks / Hooks.Tests / TransactionTestCase.cs
blob09a53a7bc230e64c1989446d380c912cabba24e0
1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle.SvnHooks.Tests
17 using System;
19 using NUnit.Framework;
21 /// <summary>
22 /// As far as I can determine subversion uses
23 /// different formats for the transaction string
24 /// on windows and unix.
25 /// </summary>
26 [TestFixture] public class TransactionTestCase
28 [Test] public void ParseWindowsFormat()
30 Transaction t = Transaction.Parse("0-1");
32 Assert.AreEqual("0-1", t.ToString(), "Transaction.ToString does not match the parsed string");
34 [Test] public void ParseUnixFormat()
36 Transaction t = Transaction.Parse("1u");
38 Assert.AreEqual("1u", t.ToString(), "Transaction.ToString does not match the parsed string");
41 [Ignore("The transaction numbers dont seem to be from revision - to reveision, but rather something else")]
42 [ExpectedException(typeof(FormatException))]
43 [Test] public void ParseNegativeFromRevision()
45 Transaction t = Transaction.Parse(String.Concat(-1, '-', 10));
47 [Ignore("The transaction numbers dont seem to be from revision - to reveision, but rather something else")]
48 [ExpectedException(typeof(FormatException))]
49 [Test] public void ParseToRevisionLowerThanFromRevision()
51 Transaction t = Transaction.Parse(String.Concat(10, '-', 0));
53 [Ignore("The transaction numbers dont seem to be from revision - to reveision, but rather something else")]
54 [ExpectedException(typeof(FormatException), "From revision number must be lower than To revision: 10-10")]
55 [Test] public void ParseToRevisionEqualFromRevision()
57 Transaction t = Transaction.Parse(String.Concat(10, '-', 10));