@@ -3,6 +3,16 @@ Import SourceControl.Git
3
3
Class UnitTest .SourceControl .Git .AddRemove Extends %UnitTest .TestCase
4
4
{
5
5
6
+ Method TestInit ()
7
+ {
8
+ new %SourceControl
9
+ do ##class (%Studio.SourceControl.Interface ).SourceControlCreate ()
10
+ set sc = %SourceControl .UserAction (0 ," %SourceMenu,Init" ," " ," " ,.action ,.target ,.msg ,.reload )
11
+ zw sc
12
+ break
13
+ do $$$AssertStatusOK(sc )
14
+ }
15
+
6
16
Method TestMac ()
7
17
{
8
18
do $$$AssertEquals(##class (Utils ).IsInSourceControl (" test.mac" ),0 )
@@ -34,5 +44,29 @@ Method OnBeforeAllTests() As %Status
34
44
quit $$$OK
35
45
}
36
46
47
+ Property InitialExtension As %String [ InitialExpression = {##class (%Studio.SourceControl.Interface ).SourceControlClassGet ()} ];
48
+
49
+ Property SourceControlGlobal [ MultiDimensional ];
50
+
51
+ Method %OnNew (initvalue ) As %Status
52
+ {
53
+ Merge ..SourceControlGlobal = ^SYS (" SourceControl" )
54
+ Kill ^SYS (" SourceControl" )
55
+ Set folder = ##class (%Library.File ).TempFilename ()_" dir"
56
+ Do ##class (%Library.File ).CreateDirectory (folder )
57
+ Set ^SYS (" SourceControl" ," Git" ," settings" ," namespaceTemp" ) = folder
58
+ Set ^SYS (" SourceControl" ," Git" ," settings" ," mappings" ," MAC" ," *" )=" rtn/"
59
+ Do ##class (%Studio.SourceControl.Interface ).SourceControlClassSet (" SourceControl.Git.Extension" )
60
+ Quit ##super (initvalue )
61
+ }
62
+
63
+ Method %OnClose () As %Status [ Private , ServerOnly = 1 ]
64
+ {
65
+ Do ##class (%Studio.SourceControl.Interface ).SourceControlClassSet (..InitialExtension )
66
+ Kill ^SYS (" SourceControl" )
67
+ Merge ^SYS (" SourceControl" ) = ..SourceControlGlobal
68
+ Quit $$$OK
69
+ }
70
+
37
71
}
38
72
0 commit comments