|
1 | 1 | using System; |
2 | 2 | using Notion.Client; |
| 3 | +using Notion.Client.Extensions; |
3 | 4 | using Xunit; |
4 | 5 |
|
5 | 6 | namespace Notion.UnitTests |
@@ -33,5 +34,33 @@ public void TestPropertyType(Type type, PropertyType expectedPropertyType) |
33 | 34 |
|
34 | 35 | Assert.Equal(expectedPropertyType, actualPropertyType); |
35 | 36 | } |
| 37 | + |
| 38 | + [Theory] |
| 39 | + [InlineData(typeof(CheckboxProperty), "checkbox")] |
| 40 | + [InlineData(typeof(CreatedByProperty), "created_by")] |
| 41 | + [InlineData(typeof(CreatedTimeProperty), "created_time")] |
| 42 | + [InlineData(typeof(DateProperty), "date")] |
| 43 | + [InlineData(typeof(EmailProperty), "email")] |
| 44 | + [InlineData(typeof(FileProperty), "file")] |
| 45 | + [InlineData(typeof(FormulaProperty), "formula")] |
| 46 | + [InlineData(typeof(LastEditedByProperty), "last_edited_by")] |
| 47 | + [InlineData(typeof(LastEditedTimeProperty), "last_edited_time")] |
| 48 | + [InlineData(typeof(NumberProperty), "number")] |
| 49 | + [InlineData(typeof(PeopleProperty), "people")] |
| 50 | + [InlineData(typeof(PhoneNumberProperty), "phone_number")] |
| 51 | + [InlineData(typeof(RelationProperty), "relation")] |
| 52 | + [InlineData(typeof(RichTextProperty), "rich_text")] |
| 53 | + [InlineData(typeof(RollupProperty), "rollup")] |
| 54 | + [InlineData(typeof(SelectProperty), "select")] |
| 55 | + [InlineData(typeof(TitleProperty), "title")] |
| 56 | + [InlineData(typeof(UrlProperty), "url")] |
| 57 | + public void TestPropertyTypeText(Type type, string expectedPropertyType) |
| 58 | + { |
| 59 | + var typeInstance = (Property)Activator.CreateInstance(type); |
| 60 | + |
| 61 | + var actualPropertyType = typeInstance.Type.GetEnumMemberValue(); |
| 62 | + |
| 63 | + Assert.Equal(expectedPropertyType, actualPropertyType); |
| 64 | + } |
36 | 65 | } |
37 | 66 | } |
0 commit comments