Skip to content
This repository was archived by the owner on Jun 30, 2022. It is now read-only.

Commit 3652c33

Browse files
ChengxianMoKayMKM
authored andcommitted
[Calendar] Add Exception Handling, Code Refine, Add More Tests (#455)
* refine namespace * add more tests * add tests for common tools * add exception handling * add timezone converter test * fix google client error message * refine and fix stylecop * fix stylecop * add exception test in service tests * add exception test for msgraph service tgest * add exception handling flow test * fix stylecop * fix style cop * change static to const
1 parent faff655 commit 3652c33

File tree

66 files changed

+2527
-1721
lines changed

Some content is hidden

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

66 files changed

+2527
-1721
lines changed

solutions/Virtual-Assistant/src/csharp/skills/calendarskill/CalendarSkill.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
// Licensed under the MIT License.
33

44
using System;
5-
using System.Linq;
65
using System.Threading;
76
using System.Threading.Tasks;
7+
using CalendarSkill.ServiceClients;
88
using Microsoft.Bot.Builder;
99
using Microsoft.Bot.Builder.Dialogs;
10-
using Microsoft.Bot.Schema;
1110
using Microsoft.Bot.Solutions.Skills;
1211

1312
namespace CalendarSkill
@@ -22,7 +21,7 @@ public class CalendarSkill : IBot
2221
private readonly ConversationState _conversationState;
2322
private readonly IBotTelemetryClient _telemetryClient;
2423
private readonly IServiceManager _serviceManager;
25-
private bool _skillMode;
24+
private readonly bool _skillMode;
2625
private DialogSet _dialogs;
2726

2827
public CalendarSkill(ISkillConfiguration services, ConversationState conversationState, UserState userState, IBotTelemetryClient telemetryClient, IServiceManager serviceManager = null, bool skillMode = false)

solutions/Virtual-Assistant/src/csharp/skills/calendarskill/CalendarSkill.csproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145
<None Update="Models\Resources\AskParameterTemplate.txt">
146146
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
147147
</None>
148-
<None Update="ServiceClients\WindowsIanaMapping">
148+
<None Update="Common\WindowsIanaMapping">
149149
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
150150
</None>
151151
</ItemGroup>
@@ -222,4 +222,8 @@
222222
<LastGenOutput>CalendarCommonStrings.Designer.cs</LastGenOutput>
223223
</EmbeddedResource>
224224
</ItemGroup>
225+
226+
<ItemGroup>
227+
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
228+
</ItemGroup>
225229
</Project>

solutions/Virtual-Assistant/src/csharp/skills/calendarskill/CalendarSkillState.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using CalendarSkill.Models;
34
using Microsoft.Graph;
45

56
namespace CalendarSkill
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using System.IO;
44
using System.Reflection;
55

6-
namespace CalendarSkill
6+
namespace CalendarSkill.Common
77
{
88
public static class TimeZoneConverter
99
{
@@ -35,7 +35,7 @@ public static string WindowsToIana(string windowsTimeZoneId)
3535
private static void LoadData()
3636
{
3737
var dir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
38-
var resDir = Path.Combine(dir, @"ServiceClients\WindowsIanaMapping");
38+
var resDir = Path.Combine(dir, @"Common\WindowsIanaMapping");
3939

4040
using (var mappingFile = new FileStream(resDir, FileMode.Open))
4141
using (var sr = new StreamReader(mappingFile))

0 commit comments

Comments
 (0)