Skip to content

Commit

Permalink
Bumping version to 2.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Forkmann committed Jun 10, 2024
1 parent fb9b637 commit 6b7f90a
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 18 deletions.
2 changes: 2 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#### 2.0.8 - 2024-06-10
* Fix appendOptional
#### 2.0.7 - 2024-06-06
* chunk batch operations
#### 2.0.6 - 2024-06-06
Expand Down
2 changes: 1 addition & 1 deletion src/AzureTackle/AzureTackle.fs
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ type TableEntityExtensions =
/// - `key`: The key of the property.
/// - `value`: The value of the property.
[<Extension>]
static member inline AppendOptional(entity: TableEntity, key: string, value: obj option) =
static member inline AppendOptional(entity: TableEntity, key: string, value: 'a option) =
match value with
| Some value -> entity.Add(key, value)
| None -> ()
Expand Down
51 changes: 34 additions & 17 deletions tests/AzureTackle.Tests/Tests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ let TestTable = "TestTable"
type TestData = {
PartKey: string
RowKey: string
Date: DateTimeOffset
ValidFrom: DateTimeOffset
ValidTo: DateTimeOffset option
Exists: bool
Value: float
ValueDecimal: decimal
Expand All @@ -32,7 +33,8 @@ let simpleTest =
let testData = {
PartKey = "PartKey"
RowKey = DateTime(2024, 1, 1) |> SortedRowKey.toSortedRowKey
Date = DateTime(2024, 1, 1) |> DateTimeOffset
ValidFrom = DateTime(2024, 1, 1) |> DateTimeOffset
ValidTo = None
Value = 0.2
Exists = true
ValueDecimal = 0.2m
Expand All @@ -42,7 +44,8 @@ let simpleTest =
do!
tableProps
|> AzureTable.upsertInline (testData.PartKey, testData.RowKey) (fun set ->
set.Add("Date", testData.Date)
set.Add("ValidFrom", testData.ValidFrom)
set.Add("ValidTo", testData.ValidTo)
set.Add("Value", testData.Value)
set.Add("ValueDecimal", testData.ValueDecimal)
set.Add("Exists", testData.Exists)
Expand All @@ -55,7 +58,8 @@ let simpleTest =
|> AzureTable.execute (fun read -> {
PartKey = read.partKey
RowKey = read.rowKey
Date = read.dateTimeOffset "Date"
ValidFrom = read.dateTimeOffset "ValidFrom"
ValidTo = read.dateTimeOffsetOrNone "ValidTo"
Exists = read.bool "Exists"
Value = read.float "Value"
ValueDecimal = read.decimal "ValueDecimal"
Expand All @@ -70,7 +74,8 @@ let simpleTest =
let testData = {
PartKey = "PartKey"
RowKey = DateTime(2024, 1, 1) |> SortedRowKey.toSortedRowKey
Date = DateTime(2024, 1, 1) |> DateTimeOffset
ValidFrom = DateTime(2024, 1, 1) |> DateTimeOffset
ValidTo = None
Value = 0.2
ValueDecimal = 0.2m
Exists = true
Expand All @@ -80,7 +85,8 @@ let simpleTest =
do!
tableProps
|> AzureTable.upsertInline (testData.PartKey, testData.RowKey) (fun set ->
set.Add("Date", testData.Date)
set.Add("ValidFrom", testData.ValidFrom)
set.Add("ValidTo", testData.ValidTo)
set.Add("Value", testData.Value)
set.Add("ValueDecimal", testData.ValueDecimal)
set.Add("Exists", testData.Exists)
Expand All @@ -93,7 +99,8 @@ let simpleTest =
{
PartKey = read.partKey
RowKey = read.rowKey
Date = read.dateTimeOffset "Date"
ValidFrom = read.dateTimeOffset "ValidFrom"
ValidTo = read.dateTimeOffsetOrNone "ValidTo"
Exists = read.bool "Exists"
Value = read.float "Value"
ValueDecimal = read.decimal "ValueDecimal"
Expand Down Expand Up @@ -154,7 +161,8 @@ let simpleTest =
let testData = {
PartKey = "PartKey"
RowKey = rowKey
Date = DateTime(2024, 1, 1) |> System.DateTimeOffset
ValidFrom = DateTime(2024, 1, 1) |> DateTimeOffset
ValidTo = None
Value = 0.2
ValueDecimal = 0.2m
Exists = true
Expand All @@ -164,7 +172,8 @@ let simpleTest =
do!
tableProps
|> AzureTable.upsertInline (testData.PartKey, testData.RowKey) (fun set ->
set.Add("Date", testData.Date)
set.Add("ValidFrom", testData.ValidFrom)
set.Add("ValidTo", testData.ValidTo)
set.Add("Value", testData.Value)
set.Add("ValueDecimal", testData.ValueDecimal)
set.Add("Exists", testData.Exists)
Expand All @@ -178,7 +187,8 @@ let simpleTest =
|> AzureTable.receive (fun read -> {
PartKey = read.partKey
RowKey = read.rowKey
Date = read.dateTimeOffset "Date"
ValidFrom = read.dateTimeOffset "ValidFrom"
ValidTo = read.dateTimeOffsetOrNone "ValidTo"
Exists = read.bool "Exists"
Value = read.float "Value"
ValueDecimal = read.decimal "ValueDecimal"
Expand All @@ -194,7 +204,8 @@ let simpleTest =
let testData = {
PartKey = "PartKey"
RowKey = rowKey
Date = DateTime(2024, 1, 1) |> System.DateTimeOffset
ValidFrom = DateTime(2024, 1, 1) |> DateTimeOffset
ValidTo = None
Value = 0.2
ValueDecimal = 0.2m
Exists = true
Expand All @@ -203,7 +214,8 @@ let simpleTest =

let entity =
TableEntity(testData.PartKey, testData.RowKey)
.Append("Date", testData.Date)
.Append("ValidFrom", testData.ValidFrom)
.AppendOptional("ValidTo", testData.ValidTo)
.Append("Value", testData.Value)
.Append("ValueDecimal", testData.ValueDecimal)
.Append("Exists", testData.Exists)
Expand All @@ -217,7 +229,8 @@ let simpleTest =
|> AzureTable.receive (fun read -> {
PartKey = read.partKey
RowKey = read.rowKey
Date = read.dateTimeOffset "Date"
ValidFrom = read.dateTimeOffset "ValidFrom"
ValidTo = read.dateTimeOffsetOrNone "ValidTo"
Exists = read.bool "Exists"
Value = read.float "Value"
ValueDecimal = read.decimal "ValueDecimal"
Expand All @@ -231,7 +244,8 @@ let simpleTest =
let testData = {
PartKey = "PartKey"
RowKey = DateTime(2024, 1, 1) |> SortedRowKey.toSortedRowKey
Date = DateTime(2024, 1, 1) |> System.DateTimeOffset
ValidFrom = DateTime(2024, 1, 1) |> DateTimeOffset
ValidTo = None
Value = 0.2
ValueDecimal = 0.2m
Exists = true
Expand All @@ -241,7 +255,8 @@ let simpleTest =
do!
tableProps
|> AzureTable.upsertInline (testData.PartKey, testData.RowKey) (fun set ->
set.Add("Date", testData.Date)
set.Add("ValidFrom", testData.ValidFrom)
set.Add("ValidTo", testData.ValidTo)
set.Add("Value", testData.Value)
set.Add("ValueDecimal", testData.ValueDecimal)
set.Add("Exists", testData.Exists)
Expand All @@ -263,7 +278,8 @@ let simpleTest =
{
PartKey = "PartKey"
RowKey = DateTime(2024, 1, 1) |> SortedRowKey.toSortedRowKey
Date = DateTime(2024, 1, 1) |> System.DateTimeOffset
ValidFrom = DateTime(2024, 1, 1) |> DateTimeOffset
ValidTo = None
Value = 0.2
ValueDecimal = 0.2m
Exists = true
Expand All @@ -275,7 +291,8 @@ let simpleTest =
testData
|> Array.map (fun d ->
TableEntity(d.PartKey, d.RowKey)
.Append("Date", d.Date)
.Append("ValidFrom", d.ValidFrom)
.AppendOptional("ValidTo", d.ValidTo)
.Append("Exists", d.Exists)
.Append("Text", d.Text)
.Append("Value", d.Value)
Expand Down

0 comments on commit 6b7f90a

Please sign in to comment.