Skip to content

Commit bbd610e

Browse files
✅ add unit tests to test property type
1 parent 325ecf1 commit bbd610e

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
using System;
2+
using Notion.Client;
3+
using Xunit;
4+
5+
namespace Notion.UnitTests
6+
{
7+
public class PropertyTests
8+
{
9+
[Theory]
10+
[InlineData(typeof(CheckboxProperty), PropertyType.Checkbox)]
11+
[InlineData(typeof(CreatedByProperty), PropertyType.CreatedBy)]
12+
[InlineData(typeof(CreatedTimeProperty), PropertyType.CreatedTime)]
13+
[InlineData(typeof(DateProperty), PropertyType.Date)]
14+
[InlineData(typeof(EmailProperty), PropertyType.Email)]
15+
[InlineData(typeof(FileProperty), PropertyType.File)]
16+
[InlineData(typeof(FormulaProperty), PropertyType.Formula)]
17+
[InlineData(typeof(LastEditedByProperty), PropertyType.LastEditedBy)]
18+
[InlineData(typeof(LastEditedTimeProperty), PropertyType.LastEditedTime)]
19+
[InlineData(typeof(NumberProperty), PropertyType.Number)]
20+
[InlineData(typeof(PeopleProperty), PropertyType.People)]
21+
[InlineData(typeof(PhoneNumberProperty), PropertyType.PhoneNumber)]
22+
[InlineData(typeof(RelationProperty), PropertyType.Relation)]
23+
[InlineData(typeof(RichTextProperty), PropertyType.RichText)]
24+
[InlineData(typeof(RollupProperty), PropertyType.Rollup)]
25+
[InlineData(typeof(SelectProperty), PropertyType.Select)]
26+
[InlineData(typeof(TitleProperty), PropertyType.Title)]
27+
[InlineData(typeof(UrlProperty), PropertyType.Url)]
28+
public void TestPropertyType(Type type, PropertyType expectedPropertyType)
29+
{
30+
var typeInstance = (Property)Activator.CreateInstance(type);
31+
32+
var actualPropertyType = typeInstance.Type;
33+
34+
Assert.Equal(expectedPropertyType, actualPropertyType);
35+
}
36+
}
37+
}

0 commit comments

Comments
 (0)