Skip to content

Commit

Permalink
Merge pull request #37 from notion-dotnet/bfix/34-date-property-has-t…
Browse files Browse the repository at this point in the history
…ype-multiselect

Fix DateProperty has type multiselect 🐛
  • Loading branch information
KoditkarVedant authored Jul 17, 2021
2 parents 019b7f8 + bbd610e commit a08bb18
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Notion.Client
{
public class DateProperty : Property
{
public override PropertyType Type => PropertyType.MultiSelect;
public override PropertyType Type => PropertyType.Date;
public Dictionary<string, object> Date { get; set; }
}
}
37 changes: 37 additions & 0 deletions Test/Notion.UnitTests/PropertyTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using System;
using Notion.Client;
using Xunit;

namespace Notion.UnitTests
{
public class PropertyTests
{
[Theory]
[InlineData(typeof(CheckboxProperty), PropertyType.Checkbox)]
[InlineData(typeof(CreatedByProperty), PropertyType.CreatedBy)]
[InlineData(typeof(CreatedTimeProperty), PropertyType.CreatedTime)]
[InlineData(typeof(DateProperty), PropertyType.Date)]
[InlineData(typeof(EmailProperty), PropertyType.Email)]
[InlineData(typeof(FileProperty), PropertyType.File)]
[InlineData(typeof(FormulaProperty), PropertyType.Formula)]
[InlineData(typeof(LastEditedByProperty), PropertyType.LastEditedBy)]
[InlineData(typeof(LastEditedTimeProperty), PropertyType.LastEditedTime)]
[InlineData(typeof(NumberProperty), PropertyType.Number)]
[InlineData(typeof(PeopleProperty), PropertyType.People)]
[InlineData(typeof(PhoneNumberProperty), PropertyType.PhoneNumber)]
[InlineData(typeof(RelationProperty), PropertyType.Relation)]
[InlineData(typeof(RichTextProperty), PropertyType.RichText)]
[InlineData(typeof(RollupProperty), PropertyType.Rollup)]
[InlineData(typeof(SelectProperty), PropertyType.Select)]
[InlineData(typeof(TitleProperty), PropertyType.Title)]
[InlineData(typeof(UrlProperty), PropertyType.Url)]
public void TestPropertyType(Type type, PropertyType expectedPropertyType)
{
var typeInstance = (Property)Activator.CreateInstance(type);

var actualPropertyType = typeInstance.Type;

Assert.Equal(expectedPropertyType, actualPropertyType);
}
}
}

0 comments on commit a08bb18

Please sign in to comment.