Skip to content

Commit a08bb18

Browse files
Merge pull request #37 from notion-dotnet/bfix/34-date-property-has-type-multiselect
Fix DateProperty has type multiselect 🐛
2 parents 019b7f8 + bbd610e commit a08bb18

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

Src/Notion.Client/Models/Database/Properties/DateProperty.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ namespace Notion.Client
44
{
55
public class DateProperty : Property
66
{
7-
public override PropertyType Type => PropertyType.MultiSelect;
7+
public override PropertyType Type => PropertyType.Date;
88
public Dictionary<string, object> Date { get; set; }
99
}
1010
}
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)