Skip to content

Commit 17ffcbe

Browse files
committed
Add unit tests for OlRibbonType enum #223
1 parent d737ff6 commit 17ffcbe

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed

Source/NetOffice.Tests/NetOffice.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
<Reference Include="System.Xml" />
4747
</ItemGroup>
4848
<ItemGroup>
49+
<Compile Include="OutlookApi\Tools\OlRibbonTypeTests.cs" />
4950
<Compile Include="OutlookApi\Tools\OlCustomUIAttributeTests.cs" />
5051
<Compile Include="Properties\AssemblyInfo.cs" />
5152
</ItemGroup>
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
using System;
2+
using NUnit.Framework;
3+
using NetOffice.OutlookApi.Tools;
4+
5+
namespace NetOffice.Tests.OutlookApi.Tools
6+
{
7+
[TestFixture]
8+
public class OlRibbonTypeTests
9+
{
10+
[Test]
11+
[TestCase(OlRibbonType.Microsoft_Outlook_Appointment, "Microsoft.Outlook.Appointment")]
12+
[TestCase(OlRibbonType.Microsoft_Outlook_Contact, "Microsoft.Outlook.Contact")]
13+
[TestCase(OlRibbonType.Microsoft_Outlook_DistributionList, "Microsoft.Outlook.DistributionList")]
14+
[TestCase(OlRibbonType.Microsoft_Outlook_Journal, "Microsoft.Outlook.Journal")]
15+
[TestCase(OlRibbonType.Microsoft_Outlook_Mail_Compose, "Microsoft.Outlook.Mail.Compose")]
16+
[TestCase(OlRibbonType.Microsoft_Outlook_Mail_Read, "Microsoft.Outlook.Mail.Read")]
17+
[TestCase(OlRibbonType.Microsoft_Outlook_MeetingRequest_Read, "Microsoft.Outlook.MeetingRequest.Read")]
18+
[TestCase(OlRibbonType.Microsoft_Outlook_MeetingRequest_Send, "Microsoft.Outlook.MeetingRequest.Send")]
19+
[TestCase(OlRibbonType.Microsoft_Outlook_Post_Compose, "Microsoft.Outlook.Post.Compose")]
20+
[TestCase(OlRibbonType.Microsoft_Outlook_Post_Read, "Microsoft.Outlook.Post.Read")]
21+
[TestCase(OlRibbonType.Microsoft_Outlook_Report, "Microsoft.Outlook.Report")]
22+
[TestCase(OlRibbonType.Microsoft_Outlook_Resend, "Microsoft.Outlook.Resend")]
23+
[TestCase(OlRibbonType.Microsoft_Outlook_Response_Compose, "Microsoft.Outlook.Response.Compose")]
24+
[TestCase(OlRibbonType.Microsoft_Outlook_Response_CounterPropose, "Microsoft.Outlook.Response.CounterPropose")]
25+
[TestCase(OlRibbonType.Microsoft_Outlook_Response_Read, "Microsoft.Outlook.Response.Read")]
26+
[TestCase(OlRibbonType.Microsoft_Outlook_RSS, "Microsoft.Outlook.RSS")]
27+
[TestCase(OlRibbonType.Microsoft_Outlook_Sharing_Compose, "Microsoft.Outlook.Sharing.Compose")]
28+
[TestCase(OlRibbonType.Microsoft_Outlook_Sharing_Read, "Microsoft.Outlook.Sharing.Read")]
29+
[TestCase(OlRibbonType.Microsoft_Outlook_Task, "Microsoft.Outlook.Task")]
30+
[TestCase(OlRibbonType.Microsoft_Outlook_Explorer, "Microsoft.Outlook.Explorer")]
31+
public void OlRibbonType_MemberValue_IsCorrectlyConvertedToRibbonID(OlRibbonType ribbonType, string expectedValue)
32+
{
33+
// Arrange
34+
var attribute = new OlCustomUIAttribute(ribbonType, "DummyValue.xml");
35+
36+
// Act
37+
var actualValue = attribute.RibbonID;
38+
39+
// Assert
40+
Assert.AreEqual(expectedValue, actualValue);
41+
}
42+
}
43+
}

Source/Outlook/Tools/OlRibbonType.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ namespace NetOffice.OutlookApi.Tools
55
/// <summary>
66
/// Outlook Ribbon Types
77
/// </summary>
8+
/// <remarks>
9+
/// https://docs.microsoft.com/en-us/office/vba/outlook/how-to/office-fluent-ui-extensibility/implementing-the-iribbonextensibility-interface
10+
/// </remarks>
811
public enum OlRibbonType
912
{
1013
/// <summary>

0 commit comments

Comments
 (0)