Skip to content

Commit

Permalink
Use format that null_value conforms to (#4805)
Browse files Browse the repository at this point in the history
This commit updates the Format used in Date[Nanos]PropertyTests
to one that can be used to parse the null_value.
  • Loading branch information
russcam authored Jun 24, 2020
1 parent 0356fd9 commit 3b239bf
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions tests/Tests/Mapping/Types/Core/Date/DateAttributeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class DateTest
Index = false,
Boost = 1.2,
IgnoreMalformed = true,
Format = "MM/dd/yyyy")]
Format = "yyyy-MM-dd'T'HH:mm[:ss][.S]")]
public DateTime Full { get; set; }

public DateTime Inferred { get; set; }
Expand All @@ -42,7 +42,7 @@ public class DateAttributeTests : AttributeTestsBase<DateTest>
index = false,
boost = 1.2,
ignore_malformed = true,
format = "MM/dd/yyyy"
format = "yyyy-MM-dd'T'HH:mm[:ss][.S]"
},
minimal = new
{
Expand Down
6 changes: 3 additions & 3 deletions tests/Tests/Mapping/Types/Core/Date/DatePropertyTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public DatePropertyTests(WritableCluster cluster, EndpointUsage usage) : base(cl
index = false,
boost = 1.2,
ignore_malformed = true,
format = "MM/dd/yyyy",
format = "yyyy-MM-dd'T'HH:mm[:ss][.S]",
null_value = DateTime.MinValue
}
}
Expand All @@ -42,7 +42,7 @@ public DatePropertyTests(WritableCluster cluster, EndpointUsage usage) : base(cl
.Index(false)
.Boost(1.2)
.IgnoreMalformed()
.Format("MM/dd/yyyy")
.Format("yyyy-MM-dd'T'HH:mm[:ss][.S]")
.NullValue(DateTime.MinValue)
);

Expand All @@ -57,7 +57,7 @@ public DatePropertyTests(WritableCluster cluster, EndpointUsage usage) : base(cl
Index = false,
Boost = 1.2,
IgnoreMalformed = true,
Format = "MM/dd/yyyy",
Format = "yyyy-MM-dd'T'HH:mm[:ss][.S]",
NullValue = DateTime.MinValue
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class DateNanosTest
Index = false,
Boost = 1.2,
IgnoreMalformed = true,
Format = "MM/dd/yyyy")]
Format = "yyyy-MM-dd'T'HH:mm[:ss][.S]")]
public DateTime Full { get; set; }

[DateNanos]
Expand All @@ -38,7 +38,7 @@ public class DateNanosAttributeTests : AttributeTestsBase<DateNanosTest>
index = false,
boost = 1.2,
ignore_malformed = true,
format = "MM/dd/yyyy"
format = "yyyy-MM-dd'T'HH:mm[:ss][.S]"
},
minimal = new
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information

using System;
using System;
using Nest;
using Tests.Core.ManagedElasticsearch.Clusters;
using Tests.Domain;
Expand All @@ -27,7 +27,7 @@ public DateNanosPropertyTests(WritableCluster cluster, EndpointUsage usage) : ba
index = false,
boost = 1.2,
ignore_malformed = true,
format = "MM/dd/yyyy",
format = "yyyy-MM-dd'T'HH:mm[:ss][.S]",
null_value = DateTime.MinValue
}
}
Expand All @@ -42,7 +42,7 @@ public DateNanosPropertyTests(WritableCluster cluster, EndpointUsage usage) : ba
.Index(false)
.Boost(1.2)
.IgnoreMalformed()
.Format("MM/dd/yyyy")
.Format("yyyy-MM-dd'T'HH:mm[:ss][.S]")
.NullValue(DateTime.MinValue)
);

Expand All @@ -57,7 +57,7 @@ public DateNanosPropertyTests(WritableCluster cluster, EndpointUsage usage) : ba
Index = false,
Boost = 1.2,
IgnoreMalformed = true,
Format = "MM/dd/yyyy",
Format = "yyyy-MM-dd'T'HH:mm[:ss][.S]",
NullValue = DateTime.MinValue
}
}
Expand Down

0 comments on commit 3b239bf

Please sign in to comment.