master
 1<?xml version="1.0"?>
 2<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
 3  <CodeSnippet Format="1.0.0">
 4    <Header>
 5      <Title>Model</Title>
 6      <Description>Expansion snippet for a Model</Description>
 7      <Shortcut>model</Shortcut>
 8      <SnippetTypes>
 9        <SnippetType>Expansion</SnippetType>
10      </SnippetTypes>
11    </Header>
12    <Snippet>
13      <Declarations>
14        <Literal>
15          <ID>namespace</ID>
16          <ToolTip>Model namespace</ToolTip>
17          <Default>MbUnitTests</Default>
18        </Literal>
19        <Literal>
20          <ID>type</ID>
21          <ToolTip>Modelled type</ToolTip>
22          <Default>Put the modelled type here</Default>
23        </Literal>
24        <Literal>
25          <ID>basetype</ID>
26          <ToolTip>Modelled Base Type</ToolTip>
27          <Default>Object</Default>
28        </Literal>
29      </Declarations>
30      <Code Language="VB"><![CDATA[Imports System
31Imports TestFu
32Imports TestFu.Models
33
34Namespace $namespace$
35    ''' <summary>
36    ''' A IModel implementation for the $type$ type.
37    ''' </summary>
38	' <State("Put a state name here")>
39    ' <SubModel("Put a submodel name here")>
40    <Model(GetType($type$))> _    
41    Public Class $type$Model
42		Inherits $basetype$Model
43
44        #Region "Constructors"
45        ''' <summary>
46        ''' Initializes a new $type$Model instance.
47        ''' </summary>
48        Public Sub New()
49
50		End Sub
51    
52        ''' <summary>
53        ''' Initializes a new "$name$Model" instance to model the modelledType type.
54        ''' </summary>
55        ''' <param name="modelledType">
56        ''' Target Type of the model
57        ''' </param>
58        Public Sub New(ByVal modelledType As Type)
59			MyBase.New(modelledType)
60            If Not GetType($type$).IsAssignableFrom(modelledType)
61                Throw New ArgumentException("$type$ is not assignable from "+modelledType.FullName,"modelledType")
62			End If
63        End Sub   
64        #End Region
65    
66        #Region "Transitions"
67        <Transition()> _
68        Public Sub SampleTransition(ByVal target As $type$)
69            Throw New NotImplementedException()
70        End Sub
71     
72        ''' <summary>
73        ''' Gets the active ITransition instance for current target.
74        ''' </summary>
75        ''' <param name="transitions">
76        ''' Collection of active ITransition names
77        ''' </param>
78        ''' <param name="target">
79        ''' Current tested instance
80        ''' </param>
81        Protected Overrides Sub GetActiveTransitions( _
82            ByVal transitions as ITransitionNameCollection , _
83            ByVal target as Object)
84
85            MyBase.GetActiveTransitions(transitions,target)
86            Dim current As $type$ = DirectCast(target, $type$)
87
88		End Sub
89        #End Region
90    End Class
91End Namespace
92	]]></Code>
93    </Snippet>
94  </CodeSnippet>
95</CodeSnippets>