-
Notifications
You must be signed in to change notification settings - Fork 0
/
Test.bas
166 lines (128 loc) · 5.5 KB
/
Test.bas
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
Attribute VB_Name = "Test"
'--------------------------------------------------
' Test-Mail-Funktionen
'--------------------------------------------------
Public Sub Test_Attachment_Config_And_Kuerzels()
Debug.Print "Konstanten"
Debug.Print " KUERZEL_FILE >" & AttachmentConfig.KUERZEL_FILE
Debug.Print " ARCHIVE_FOLDER >" & AttachmentConfig.ARCHIVE_FOLDER
Debug.Print " FILENAME_PATTERN >" & AttachmentConfig.FILENAME_PATTERN
Debug.Print " DIRECTION_FROM >" & AttachmentConfig.DIRECTION_FROM
Debug.Print " DIRECTION_TO >" & AttachmentConfig.DIRECTION_TO
Debug.Print "Kürzel-Test"
Debug.Print " K:" & AttachmentUtil.GetKuerzel("john.doe@company-a.com") & ":K"
Debug.Print " K:" & AttachmentUtil.GetKuerzel("foo.bar@company-b.com") & ":K"
End Sub
'--------------------------------------------------
' Test-String-Funktionen
'--------------------------------------------------
Public Sub Test_String_StartsWith_EndsWith()
Debug.Print StringUtil.StartsWith("abcd", "a")
Debug.Print StringUtil.StartsWith("abcd", "b")
Debug.Print StringUtil.StartsWith("abcd", "c")
Debug.Print StringUtil.StartsWith("abcd", "d")
Debug.Print StringUtil.StartsWith("abcd", "ab")
Debug.Print StringUtil.StartsWith("abcd", "cd")
Debug.Print StringUtil.EndsWith("abcd", "a")
Debug.Print StringUtil.EndsWith("abcd", "b")
Debug.Print StringUtil.EndsWith("abcd", "c")
Debug.Print StringUtil.EndsWith("abcd", "d")
Debug.Print StringUtil.EndsWith("abcd", "ab")
Debug.Print StringUtil.EndsWith("abcd", "cd")
Debug.Print StringUtil.FirstInStr("Was wäre, wenn...?", ".,?")
Debug.Print StringUtil.FirstInStr("Was wäre, wenn...?", ",.?")
Debug.Print StringUtil.FirstInStr("Was wäre, wenn...?", "?.,")
Debug.Print StringUtil.FirstInStr("Was wäre, wenn...?", "?.")
Debug.Print StringUtil.FirstInStr("Was wäre, wenn...?", ".?")
Debug.Print StringUtil.FirstInStr("Was wäre, wenn...?", "?")
End Sub
'--------------------------------------------------
' Test-Categories-Funktionen
'--------------------------------------------------
Public Sub Test_MergeCategories()
Debug.Print MergeCategories("a;b;c;d", "c;d;e;f")
Debug.Print MergeCategories("a;b;c;d", "")
Debug.Print MergeCategories("", "a;b;c;d")
Debug.Print MergeCategories("a;b", "b")
Debug.Print MergeCategories("a;b", "a")
Debug.Print MergeCategories("a;b", "a;b")
Debug.Print MergeCategories("a;b", "b;a")
Debug.Print MergeCategories("a: b & c;1: 2 & 3", "1: 2 & 3")
Debug.Print MergeCategories("a: b & c;1: 2 & 3", "a: b & c")
Debug.Print MergeCategories("a: b & c;1: 2 & 3", "a: b & c;1: 2 & 3")
Debug.Print MergeCategories("a: b & c;1: 2 & 3", "1: 2 & 3;a: b & c")
Debug.Print MergeCategories("a;a", "a")
Dim cats As String
cats = "1;2;3"
Debug.Print MergeCategories(cats, "3;4")
Debug.Print cats
End Sub
Public Sub Print_Selection()
Debug.Print ("Print_Selection")
Debug.Print ("------------------")
For Each item In Application.ActiveExplorer.selection
Debug.Print TypeName(item); " --> "; item.Categories
Next item
Debug.Print ("------------------")
End Sub
Public Sub Test_Cert()
Dim url1 As String
Dim url2 As String
Dim request As MSXML2.XMLHTTP60
Dim result As String
url1 = "https://server1.com/login"
url2 = "https://server1.com/sjira/rest/api/latest/issue/XX-1188"
Set request = New MSXML2.XMLHTTP60
Call request.Open("POST", url1, False)
Call request.Send("login-form-type=cert")
result = request.responseText
Debug.Print result
Set request = New MSXML2.XMLHTTP60
Call request.Open("GET", url2, False)
Call request.Send
result = request.responseText
Debug.Print result
End Sub
Public Sub Test_LoginForm()
Dim username As String
Dim password As String
LoginForm.UrlLabel = "http://www.example.com"
LoginForm.Show (vbModal)
If (LoginForm.okAction) Then
username = LoginForm.username
password = LoginForm.password
Debug.Print "confirmed " & username & ":" & password
Else
username = LoginForm.username
password = LoginForm.password
Debug.Print "canceled " & username & ":" & password
End If
LoginForm.Reset (False)
End Sub
Public Sub Test_PrintTypeInfo()
Debug.Print ("Test_PrintTypeInfo")
Debug.Print ("------------------")
Dim rec As Integer
Dim item As Object
Set olA = New Outlook.Application
Set olNS = olA.GetNamespace("MAPI")
For Each item In Application.ActiveExplorer.selection
Debug.Print TypeName(item)
Dim t As TLI.TLIApplication
Set t = New TLI.TLIApplication
Dim ti As TLI.TypeInfo
Set ti = t.InterfaceInfoFromObject(item)
Dim mi As TLI.MemberInfo, i As Long
For Each mi In ti.Members
Select Case mi.DescKind
Case TLI.DESCKIND_VARDESC:
Debug.Print " VAR: ", mi.name, mi.Value
Case TLI.DESCKIND_FUNCDESC:
Select Case mi.InvokeKind
Case TLI.INVOKE_PROPERTYGET:
Debug.Print " FUNC: ", mi.name
End Select
End Select
Next mi
Next item
End Sub