Skip to content

Commit 964327c

Browse files
Use format that null_value conforms to (#4805) (#4810)
This commit updates the Format used in Date[Nanos]PropertyTests to one that can be used to parse the null_value. Co-authored-by: Russ Cam <russ.cam@elastic.co>
1 parent fdda524 commit 964327c

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

tests/Tests/Mapping/Types/Core/Date/DateAttributeTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class DateTest
1616
Index = false,
1717
Boost = 1.2,
1818
IgnoreMalformed = true,
19-
Format = "MM/dd/yyyy")]
19+
Format = "yyyy-MM-dd'T'HH:mm[:ss][.S]")]
2020
public DateTime Full { get; set; }
2121

2222
public DateTime Inferred { get; set; }
@@ -42,7 +42,7 @@ public class DateAttributeTests : AttributeTestsBase<DateTest>
4242
index = false,
4343
boost = 1.2,
4444
ignore_malformed = true,
45-
format = "MM/dd/yyyy"
45+
format = "yyyy-MM-dd'T'HH:mm[:ss][.S]"
4646
},
4747
minimal = new
4848
{

tests/Tests/Mapping/Types/Core/Date/DatePropertyTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public DatePropertyTests(WritableCluster cluster, EndpointUsage usage) : base(cl
2727
index = false,
2828
boost = 1.2,
2929
ignore_malformed = true,
30-
format = "MM/dd/yyyy",
30+
format = "yyyy-MM-dd'T'HH:mm[:ss][.S]",
3131
null_value = DateTime.MinValue
3232
}
3333
}
@@ -42,7 +42,7 @@ public DatePropertyTests(WritableCluster cluster, EndpointUsage usage) : base(cl
4242
.Index(false)
4343
.Boost(1.2)
4444
.IgnoreMalformed()
45-
.Format("MM/dd/yyyy")
45+
.Format("yyyy-MM-dd'T'HH:mm[:ss][.S]")
4646
.NullValue(DateTime.MinValue)
4747
);
4848

@@ -57,7 +57,7 @@ public DatePropertyTests(WritableCluster cluster, EndpointUsage usage) : base(cl
5757
Index = false,
5858
Boost = 1.2,
5959
IgnoreMalformed = true,
60-
Format = "MM/dd/yyyy",
60+
Format = "yyyy-MM-dd'T'HH:mm[:ss][.S]",
6161
NullValue = DateTime.MinValue
6262
}
6363
}

tests/Tests/Mapping/Types/Core/DateNanos/DateNanosAttributeTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class DateNanosTest
1616
Index = false,
1717
Boost = 1.2,
1818
IgnoreMalformed = true,
19-
Format = "MM/dd/yyyy")]
19+
Format = "yyyy-MM-dd'T'HH:mm[:ss][.S]")]
2020
public DateTime Full { get; set; }
2121

2222
[DateNanos]
@@ -38,7 +38,7 @@ public class DateNanosAttributeTests : AttributeTestsBase<DateNanosTest>
3838
index = false,
3939
boost = 1.2,
4040
ignore_malformed = true,
41-
format = "MM/dd/yyyy"
41+
format = "yyyy-MM-dd'T'HH:mm[:ss][.S]"
4242
},
4343
minimal = new
4444
{

tests/Tests/Mapping/Types/Core/DateNanos/DateNanosPropertyTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
33
// See the LICENSE file in the project root for more information
44

5-
using System;
5+
using System;
66
using Nest;
77
using Tests.Core.ManagedElasticsearch.Clusters;
88
using Tests.Domain;
@@ -27,7 +27,7 @@ public DateNanosPropertyTests(WritableCluster cluster, EndpointUsage usage) : ba
2727
index = false,
2828
boost = 1.2,
2929
ignore_malformed = true,
30-
format = "MM/dd/yyyy",
30+
format = "yyyy-MM-dd'T'HH:mm[:ss][.S]",
3131
null_value = DateTime.MinValue
3232
}
3333
}
@@ -42,7 +42,7 @@ public DateNanosPropertyTests(WritableCluster cluster, EndpointUsage usage) : ba
4242
.Index(false)
4343
.Boost(1.2)
4444
.IgnoreMalformed()
45-
.Format("MM/dd/yyyy")
45+
.Format("yyyy-MM-dd'T'HH:mm[:ss][.S]")
4646
.NullValue(DateTime.MinValue)
4747
);
4848

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

0 commit comments

Comments
 (0)