summaryrefslogtreecommitdiff
path: root/tools/MbUnit/VSSnippets/MbUnitCSharpSnippets/testfixture.snippet
blob: b023d63e2c6400dcda62d6a271904de0e4976c5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?xml version="1.0"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Title>TestFixture</Title>
      <Author>MbUnit</Author>
      <Description>Expansion snippet for TestFixture</Description>
      <Shortcut>testfixture</Shortcut>
      <SnippetTypes>
        <SnippetType>Expansion</SnippetType>
      </SnippetTypes>
    </Header>
    <Snippet>
      <Declarations>
        <Literal>
          <ID>namespace</ID>
          <ToolTip>Test namespace</ToolTip>
        </Literal>
        <Literal>
          <ID>type</ID>
          <ToolTip>Tested type</ToolTip>
        </Literal>
      </Declarations>
      <Code Language="csharp"><![CDATA[using System;
using MbUnit.Framework;

namespace $namespace$
{
    /// <summary>
    /// A <see cref="TestFixture"/> for the <see cref="$type$"/> class.
    /// </summary>
    [TestFixture]
    [TestsOn(typeof($type$))]
    public class $type$Test
    {
        #region Fields, SetUp and TearDown
        private $type$ target = null;
        
        /// <summary>
        /// Sets up the fixture
        /// </summary>
        [SetUp]
        public void SetUp()
        {
            this.target = new $type$();
        }
        /// <summary>
        /// Cleans up the fixture
        /// </summary>
        [TearDown]
        public void TearDown()
        {
            IDisposable disposable = this.target as IDisposable;
            if (disposable!=null)
                disposable.Dispose();
        }
        #endregion
    
        #region Test cases
        [Test]
        public void Test()
        {
            $end$
        }
        #endregion    
    }
}
	]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>