Skip to content

Commit ceff7bb

Browse files
author
Stanimir Karoserov
committed
renamed folders with lower cases and renamed user preferences to local settings
1 parent b631351 commit ceff7bb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+227
-225
lines changed

Application/index.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.

BCL.csproj

Lines changed: 52 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -77,66 +77,67 @@
7777
</VisualStudio>
7878
</ProjectExtensions>
7979
<ItemGroup>
80-
<TypeScriptCompile Include="Application\application.android.ts">
80+
<TypeScriptCompile Include="application\application.android.ts">
8181
<DependentUpon>application.d.ts</DependentUpon>
8282
</TypeScriptCompile>
83-
<TypeScriptCompile Include="Application\application_common.ts">
83+
<TypeScriptCompile Include="application\application_common.ts">
8484
<DependentUpon>application.d.ts</DependentUpon>
8585
</TypeScriptCompile>
86-
<TypeScriptCompile Include="Application\application.d.ts" />
87-
<TypeScriptCompile Include="Application\application.ios.ts">
86+
<TypeScriptCompile Include="application\application.d.ts" />
87+
<TypeScriptCompile Include="application\application.ios.ts">
8888
<DependentUpon>application.d.ts</DependentUpon>
8989
</TypeScriptCompile>
90-
<TypeScriptCompile Include="Console\console.ts">
90+
<TypeScriptCompile Include="console\console.ts">
9191
<DependentUpon>console.d.ts</DependentUpon>
9292
</TypeScriptCompile>
93-
<TypeScriptCompile Include="Console\console_helper.android.ts">
93+
<TypeScriptCompile Include="console\console_helper.android.ts">
9494
<DependentUpon>console_helper.d.ts</DependentUpon>
9595
</TypeScriptCompile>
96-
<TypeScriptCompile Include="Console\console_helper.d.ts" />
97-
<TypeScriptCompile Include="Console\console_helper.ios.ts">
96+
<TypeScriptCompile Include="console\console_helper.d.ts" />
97+
<TypeScriptCompile Include="console\console_helper.ios.ts">
9898
<DependentUpon>console_helper.d.ts</DependentUpon>
9999
</TypeScriptCompile>
100100
<TypeScriptCompile Include="declarations.d.ts" />
101101
<TypeScriptCompile Include="declarations.android.d.ts">
102102
<DependentUpon>declarations.d.ts</DependentUpon>
103103
</TypeScriptCompile>
104-
<TypeScriptCompile Include="Camera\camera.android.ts">
104+
<TypeScriptCompile Include="camera\camera.android.ts">
105105
<DependentUpon>camera.d.ts</DependentUpon>
106106
</TypeScriptCompile>
107-
<TypeScriptCompile Include="Camera\camera.d.ts" />
108-
<TypeScriptCompile Include="Camera\camera.ios.ts">
107+
<TypeScriptCompile Include="camera\camera.d.ts" />
108+
<TypeScriptCompile Include="camera\camera.ios.ts">
109109
<DependentUpon>camera.d.ts</DependentUpon>
110110
</TypeScriptCompile>
111111
<TypeScriptCompile Include="declarations.ios.d.ts">
112112
<DependentUpon>declarations.d.ts</DependentUpon>
113113
</TypeScriptCompile>
114-
<TypeScriptCompile Include="FileSystem\file_system.d.ts" />
115-
<TypeScriptCompile Include="FileSystem\file_system.ts">
114+
<TypeScriptCompile Include="filesystem\file_system.d.ts" />
115+
<TypeScriptCompile Include="filesystem\file_system.ts">
116116
<DependentUpon>file_system.d.ts</DependentUpon>
117117
</TypeScriptCompile>
118-
<TypeScriptCompile Include="FileSystem\file_system_access.android.ts">
118+
<TypeScriptCompile Include="filesystem\file_system_access.android.ts">
119119
<DependentUpon>file_system_access.d.ts</DependentUpon>
120120
</TypeScriptCompile>
121-
<TypeScriptCompile Include="FileSystem\file_system_access.d.ts" />
122-
<TypeScriptCompile Include="FileSystem\file_system_access.ios.ts">
121+
<TypeScriptCompile Include="filesystem\file_system_access.d.ts" />
122+
<TypeScriptCompile Include="filesystem\file_system_access.ios.ts">
123123
<DependentUpon>file_system_access.d.ts</DependentUpon>
124124
</TypeScriptCompile>
125-
<TypeScriptCompile Include="Image\image.ios.ts">
125+
<TypeScriptCompile Include="image\image.android.ts">
126126
<DependentUpon>image.d.ts</DependentUpon>
127127
</TypeScriptCompile>
128-
<TypeScriptCompile Include="Image\image.android.ts">
128+
<TypeScriptCompile Include="image\image.d.ts" />
129+
<TypeScriptCompile Include="image\image.ios.ts">
129130
<DependentUpon>image.d.ts</DependentUpon>
130131
</TypeScriptCompile>
131-
<TypeScriptCompile Include="Image\image.d.ts" />
132-
<TypeScriptCompile Include="Location\location.android.ts">
132+
<TypeScriptCompile Include="image\index.ts" />
133+
<TypeScriptCompile Include="location\location.android.ts">
133134
<DependentUpon>location.d.ts</DependentUpon>
134135
</TypeScriptCompile>
135-
<TypeScriptCompile Include="Location\location.d.ts" />
136-
<TypeScriptCompile Include="Location\location.ios.ts">
136+
<TypeScriptCompile Include="location\location.d.ts" />
137+
<TypeScriptCompile Include="location\location.ios.ts">
137138
<DependentUpon>location.d.ts</DependentUpon>
138139
</TypeScriptCompile>
139-
<TypeScriptCompile Include="Location\location_types.ts">
140+
<TypeScriptCompile Include="location\location_types.ts">
140141
<DependentUpon>location.d.ts</DependentUpon>
141142
</TypeScriptCompile>
142143
<TypeScriptCompile Include="Tests\file_system_tests.ts" />
@@ -153,16 +154,9 @@
153154
<TypeScriptCompile Include="text\text.ios.ts">
154155
<DependentUpon>text.d.ts</DependentUpon>
155156
</TypeScriptCompile>
156-
<TypeScriptCompile Include="UserPreferences\user_preferences.android.ts">
157-
<DependentUpon>user_preferences.d.ts</DependentUpon>
158-
</TypeScriptCompile>
159-
<TypeScriptCompile Include="UserPreferences\user_preferences.d.ts" />
160-
<TypeScriptCompile Include="UserPreferences\user_preferences.ios.ts">
161-
<DependentUpon>user_preferences.d.ts</DependentUpon>
162-
</TypeScriptCompile>
163-
<TypeScriptCompile Include="Utils\module_merge.ts" />
164-
<TypeScriptCompile Include="Utils\utils_android.ts" />
165-
<TypeScriptCompile Include="Utils\utils_ios.ts" />
157+
<TypeScriptCompile Include="utils\module_merge.ts" />
158+
<TypeScriptCompile Include="utils\utils_android.ts" />
159+
<TypeScriptCompile Include="utils\utils_ios.ts" />
166160
<TypeScriptCompile Include="http\http_request.android.ts">
167161
<DependentUpon>http_request.d.ts</DependentUpon>
168162
</TypeScriptCompile>
@@ -173,13 +167,11 @@
173167
</ItemGroup>
174168
<ItemGroup>
175169
<TypeScriptCompile Include="http\index.ts" />
176-
<TypeScriptCompile Include="UserPreferences\index.ts" />
177-
<TypeScriptCompile Include="Location\index.ts" />
178-
<TypeScriptCompile Include="Image\index.ts" />
179-
<TypeScriptCompile Include="FileSystem\index.ts" />
180-
<TypeScriptCompile Include="Console\index.ts" />
181-
<TypeScriptCompile Include="Camera\index.ts" />
182-
<TypeScriptCompile Include="Application\index.ts" />
170+
<TypeScriptCompile Include="location\index.ts" />
171+
<TypeScriptCompile Include="filesystem\index.ts" />
172+
<TypeScriptCompile Include="console\index.ts" />
173+
<TypeScriptCompile Include="camera\index.ts" />
174+
<TypeScriptCompile Include="application\index.ts" />
183175
<TypeScriptCompile Include="android17.d.ts" />
184176
<TypeScriptCompile Include="promises\promises.ts" />
185177
<TypeScriptCompile Include="promises\index.ts" />
@@ -190,21 +182,28 @@
190182
<TypeScriptCompile Include="timer\timer.android.ts">
191183
<DependentUpon>timer.d.ts</DependentUpon>
192184
</TypeScriptCompile>
193-
<TypeScriptCompile Include="UserPreferences\user_preferences_common.ts">
194-
<DependentUpon>user_preferences.d.ts</DependentUpon>
195-
</TypeScriptCompile>
196-
<TypeScriptCompile Include="Console\console.d.ts" />
185+
<TypeScriptCompile Include="console\console.d.ts" />
197186
<TypeScriptCompile Include="timer\timer.d.ts" />
198187
<TypeScriptCompile Include="timer\timer.ios.ts">
199188
<DependentUpon>timer.d.ts</DependentUpon>
200189
</TypeScriptCompile>
201-
<TypeScriptCompile Include="Tests\user_preferences_tests.ts" />
190+
<TypeScriptCompile Include="Tests\local_settings_tests.ts" />
191+
<Content Include="image\Readme.md" />
192+
<Content Include="localsettings\index.ts" />
193+
<Content Include="localsettings\local_settings.android.ts">
194+
<DependentUpon>local_settings.d.ts</DependentUpon>
195+
</Content>
196+
<Content Include="localsettings\local_settings.d.ts" />
197+
<Content Include="localsettings\local_settings.ios.ts">
198+
<DependentUpon>local_settings.d.ts</DependentUpon>
199+
</Content>
200+
<Content Include="localsettings\local_settings_common.ts">
201+
<DependentUpon>local_settings.d.ts</DependentUpon>
202+
</Content>
202203
<Content Include="_references.ts" />
203-
<Content Include="Image\Readme.md" />
204204
</ItemGroup>
205205
<ItemGroup>
206206
<TypeScriptCompile Include="libjs.d.ts" />
207-
<Content Include="UserPreferences\Readme.md" />
208207
</ItemGroup>
209208
<ItemGroup>
210209
<Content Include="http\Readme.md" />
@@ -213,17 +212,17 @@
213212
<Content Include="Readme.md" />
214213
</ItemGroup>
215214
<ItemGroup>
216-
<Content Include="Console\Readme.md" />
215+
<Content Include="console\Readme.md" />
217216
</ItemGroup>
218217
<ItemGroup>
219218
<Folder Include="Deploy\Eclipse\" />
220219
<Folder Include="Deploy\xCode\" />
221220
</ItemGroup>
222221
<ItemGroup>
223-
<Content Include="Location\Readme.md" />
222+
<Content Include="location\Readme.md" />
224223
</ItemGroup>
225224
<ItemGroup>
226-
<Content Include="Application\Readme.md" />
225+
<Content Include="application\Readme.md" />
227226
</ItemGroup>
228227
<ItemGroup>
229228
<Content Include="globals\Readme.md" />
@@ -237,6 +236,9 @@
237236
<ItemGroup>
238237
<Content Include="Tests\Readme.md" />
239238
</ItemGroup>
239+
<ItemGroup>
240+
<Content Include="localsettings\Readme.md" />
241+
</ItemGroup>
240242
<PropertyGroup Condition="'$(Configuration)' == 'iOS'">
241243
<TypeScriptModuleKind>commonjs</TypeScriptModuleKind>
242244
<TypeScriptRemoveComments>True</TypeScriptRemoveComments>

Console/index.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.

FileSystem/index.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.

Image/index.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.

Location/index.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.

Tests/file_system_tests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// # File System
44
// Using the file system requires the FileSystem module.
55
// ``` JavaScript
6-
var fs = require("FileSystem");
6+
var fs = require("filesystem");
77
// ```
88
// The pre-required `fs` module is used throughout the following code snippets.
99
// </snippet>

Tests/local_settings_tests.ts

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+

2+
var TKUnit = require("Tests/TKUnit");
3+
var LocalSettings = require("localsettings");
4+
5+
var stringKey:string = "stringKey";
6+
var boolKey: string = "boolKey";
7+
var numberKey: string = "numberKey";
8+
var noStringKey: string = "noStringKey";
9+
var noBoolKey: string = "noBoolKey";
10+
var noNumberKey: string = "noNumberKey";
11+
12+
export var testBoolean = function () {
13+
LocalSettings.setBoolean(boolKey, false);
14+
TKUnit.assert(false == LocalSettings.getBoolean(boolKey), "Cannot set boolean to false, currently it is: " + LocalSettings.getBoolean(boolKey));
15+
16+
LocalSettings.setBoolean(boolKey, true);
17+
TKUnit.assert(true == LocalSettings.getBoolean(boolKey, false), "Cannot set boolean to true");
18+
19+
TKUnit.assert(true == LocalSettings.getBoolean(boolKey), "Cannot set boolean to true (no default)");
20+
};
21+
22+
export var testString = function () {
23+
LocalSettings.setString(stringKey, "String value");
24+
TKUnit.assert("String value" === LocalSettings.getString(stringKey), "Cannot set string value");
25+
};
26+
27+
export var testNumber = function () {
28+
LocalSettings.setNumber(numberKey, 54.321);
29+
var value = LocalSettings.getNumber(numberKey).toFixed(3);
30+
TKUnit.assert(54.321 == value, "Cannot set number value 54.321 != " + value);
31+
};
32+
33+
export var testDefaults = function () {
34+
TKUnit.assert("No string value" === LocalSettings.getString(noStringKey, "No string value"), "Bad default string value");
35+
TKUnit.assert(true === LocalSettings.getBoolean(noBoolKey, true), "Bad default boolean value");
36+
TKUnit.assert(123.45 === LocalSettings.getNumber(noNumberKey, 123.45), "Bad default number value");
37+
};
38+
39+
export var testHasKey = function () {
40+
TKUnit.assert(!LocalSettings.hasKey(noBoolKey), "There is a key: " + noBoolKey);
41+
TKUnit.assert(!LocalSettings.hasKey(noStringKey), "There is a key: " + noStringKey);
42+
TKUnit.assert(!LocalSettings.hasKey(noNumberKey), "There is a key: " + noNumberKey);
43+
44+
TKUnit.assert(LocalSettings.hasKey(boolKey), "There is no key: " + boolKey);
45+
TKUnit.assert(LocalSettings.hasKey(stringKey), "There is no key: " + stringKey);
46+
TKUnit.assert(LocalSettings.hasKey(numberKey), "There is no key: " + numberKey);
47+
};
48+
49+
export var testRemove = function () {
50+
LocalSettings.remove(boolKey);
51+
TKUnit.assert(!LocalSettings.hasKey(boolKey), "Failed to remove key: " + boolKey);
52+
53+
LocalSettings.remove(stringKey);
54+
TKUnit.assert(!LocalSettings.hasKey(stringKey), "Failed to remove key: " + stringKey);
55+
56+
LocalSettings.remove(numberKey);
57+
TKUnit.assert(!LocalSettings.hasKey(numberKey), "Failed to remove key: " + numberKey);
58+
};
59+
60+
export var testInvalidKey = function () {
61+
try {
62+
LocalSettings.hasKey(undefined);
63+
TKUnit.assert(false, "There is a key undefined");
64+
}
65+
catch (e) {
66+
// we should receive an exception here
67+
}
68+
69+
try {
70+
LocalSettings.hasKey(null);
71+
TKUnit.assert(false, "There is a key null");
72+
}
73+
catch (e) {
74+
// we should receive an exception here
75+
}
76+
77+
try {
78+
LocalSettings.hasKey(123);
79+
TKUnit.assert(false, "There is a key number");
80+
}
81+
catch (e) {
82+
// we should receive an exception here
83+
}
84+
85+
LocalSettings.hasKey("string");
86+
};
87+
88+
export var testInvalidValue = function () {
89+
try {
90+
LocalSettings.setBoolean(boolKey, "str");
91+
TKUnit.assert(false, "There is a key undefined");
92+
}
93+
catch (e) {
94+
// we should receive an exception here
95+
}
96+
97+
try {
98+
LocalSettings.setBoolean(boolKey, 123);
99+
TKUnit.assert(false, "There is a key undefined");
100+
}
101+
catch (e) {
102+
// we should receive an exception here
103+
}
104+
105+
try {
106+
LocalSettings.setString(boolKey, true);
107+
TKUnit.assert(false, "There is a key undefined");
108+
}
109+
catch (e) {
110+
// we should receive an exception here
111+
}
112+
113+
try {
114+
LocalSettings.setString(boolKey, 123);
115+
TKUnit.assert(false, "There is a key undefined");
116+
}
117+
catch (e) {
118+
// we should receive an exception here
119+
}
120+
121+
try {
122+
LocalSettings.setNumber(boolKey, true);
123+
TKUnit.assert(false, "There is a key undefined");
124+
}
125+
catch (e) {
126+
// we should receive an exception here
127+
}
128+
129+
try {
130+
LocalSettings.setNumber(boolKey, "123");
131+
TKUnit.assert(false, "There is a key undefined");
132+
}
133+
catch (e) {
134+
// we should receive an exception here
135+
}
136+
137+
};

Tests/location_tests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import TKUnit = require("Tests/TKUnit");
2-
import locationModule = require("Location/location");
2+
import locationModule = require("location/location");
33

44
var LocationManager = locationModule.LocationManager;
55
var Location = locationModule.Location;

Tests/testRunner.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
var fsTests = require("Tests/file_system_tests");
33
var httpTests = require("Tests/http_tests");
44
var locationTests = require("Tests/location_tests");
5-
var userPreferencesTests = require("Tests/user_preferences_tests");
5+
var localSettingsTests = require("Tests/local_settings_tests");
66

77
export var runAll = function () {
88
TKUnit.runTestModule(fsTests, "FILE SYSTEM");
99
TKUnit.runTestModule(httpTests, "HTTP");
1010
TKUnit.runTestModule(locationTests, "LOCATION");
11-
TKUnit.runTestModule(userPreferencesTests, "USER PREFERENCES");
11+
TKUnit.runTestModule(localSettingsTests, "LOCAL SETTINGS");
1212
}

0 commit comments

Comments
 (0)