Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,4 @@
<Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
</ItemGroup>

<ItemGroup>
<Folder Include="ValueStringBuilderFeatures\Net80\" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
Feature: Append content into a UTF-8 ValueStringBuilder

Scenario Outline: Fits in available space
Given a UTF-8 ValueStringBuilder initialized with '<InitializationType>' of length <InitialLength>
And I append '<FirstValue>' to the UTF-8 ValueStringBuilder
And I append '<SecondValue>' to the UTF-8 ValueStringBuilder
When I get the string from the UTF-8 ValueStringBuilder
Then the UTF-8 ValueStringBuilder string should be '<FirstValue><SecondValue>'
Examples:
| InitializationType | InitialLength | FirstValue | SecondValue |
| Span | 11 | Hello | World! |
| Capacity | 11 | Hello | World! |
| Span | 20 | Hello | World! |
| Capacity | 20 | Hello | World! |

Scenario Outline: Grows
Given a UTF-8 ValueStringBuilder initialized with '<InitializationType>' of length <InitialLength>
And I append '<FirstValue>' to the UTF-8 ValueStringBuilder
And I append '<SecondValue>' to the UTF-8 ValueStringBuilder
When I get the string from the UTF-8 ValueStringBuilder via '<GetStringMechanism>'
Then the UTF-8 ValueStringBuilder string should be '<FirstValue><SecondValue>'
Examples:
| InitializationType | InitialLength | FirstValue | SecondValue | GetStringMechanism |
| Span | 11 | Hello, world! | It is mighty fine to see you today. | CreateStringAndDispose |
| Capacity | 11 | Hello, world! | It is mighty fine to see you today. | CreateStringAndDispose |
| Span | 11 | Hello, world! | It is mighty fine to see you today. | RentedBuffer |
| Capacity | 11 | Hello, world! | It is mighty fine to see you today. | RentedBuffer |

Scenario Outline: Append number
Given a UTF-8 ValueStringBuilder initialized with '<InitializationType>' of length <InitialLength>
And I append '<FirstValue>' to the UTF-8 ValueStringBuilder
And I append the Int32 <SecondValue> to the UTF-8 ValueStringBuilder
When I get the string from the UTF-8 ValueStringBuilder
Then the UTF-8 ValueStringBuilder string should be '<FirstValue><SecondValue>'
Examples:
| InitializationType | InitialLength | FirstValue | SecondValue |
| Span | 13 | Hello, world! | 42 |
| Capacity | 13 | Hello, world! | 42 |
| Span | 15 | Hello, world! | 42 |
| Capacity | 15 | Hello, world! | 42 |
| Span | 13 | Hello, world! | -42 |
| Capacity | 13 | Hello, world! | -42 |
| Span | 15 | Hello, world! | -42 |
| Capacity | 15 | Hello, world! | -42 |

Scenario Outline: Append number then string
Given a UTF-8 ValueStringBuilder initialized with '<InitializationType>' of length <InitialLength>
And I append the Int32 <FirstValue> to the UTF-8 ValueStringBuilder
And I append '<SecondValue>' to the UTF-8 ValueStringBuilder
When I get the string from the UTF-8 ValueStringBuilder
Then the UTF-8 ValueStringBuilder string should be '<FirstValue><SecondValue>'
Examples:
| InitializationType | InitialLength | FirstValue | SecondValue |
| Span | 13 | 42 | Hello, world! |
| Capacity | 13 | 42 | Hello, world! |
| Span | 15 | 42 | Hello, world! |
| Capacity | 15 | 42 | Hello, world! |
| Span | 13 | -42 | Hello, world! |
| Capacity | 13 | -42 | Hello, world! |
| Span | 15 | -42 | Hello, world! |
| Capacity | 15 | -42 | Hello, world! |
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
Feature: Retrieve a Memory from a UTF-8 ValueStringBuilder

Scenario Outline: Retrieve a Memory from a UTF-8 ValueStringBuilder
Given a UTF-8 ValueStringBuilder initialized with '<InitializationType>' of length <InitialLength>
And I append 'Hello' to the UTF-8 ValueStringBuilder
And I append 'World!' to the UTF-8 ValueStringBuilder
When I get the Memory from the UTF-8 ValueStringBuilder
Then the UTF-8 ValueStringBuilder string should be 'HelloWorld!'
Examples:
| InitializationType | InitialLength |
| Span | 10 |
| Capacity | 10 |
| Span | 11 |
| Capacity | 11 |
| Span | 20 |
| Capacity | 20 |

Scenario Outline: Retrieve a Memory with a start position from a UTF-8 ValueStringBuilder
Given a UTF-8 ValueStringBuilder initialized with '<InitializationType>' of length <InitialLength>
And I append 'Hello' to the UTF-8 ValueStringBuilder
And I append 'World!' to the UTF-8 ValueStringBuilder
When I get the Memory starting at <Start> from the UTF-8 ValueStringBuilder
Then the UTF-8 ValueStringBuilder string should be '<ExpectedValue>'
Examples:
| InitializationType | InitialLength | Start | ExpectedValue |
| Span | 10 | 0 | HelloWorld! |
| Capacity | 10 | 0 | HelloWorld! |
| Span | 20 | 0 | HelloWorld! |
| Capacity | 20 | 0 | HelloWorld! |
| Span | 10 | 3 | loWorld! |
| Capacity | 10 | 3 | loWorld! |
| Span | 20 | 3 | loWorld! |
| Capacity | 20 | 3 | loWorld! |


Scenario Outline: Retrieve a Memory with a start position and length from a UTF-8 ValueStringBuilder
Given a UTF-8 ValueStringBuilder initialized with '<InitializationType>' of length <InitialLength>
And I append 'Hello' to the UTF-8 ValueStringBuilder
And I append 'World!' to the UTF-8 ValueStringBuilder
When I get the Memory starting at <Start> with length <Length> from the UTF-8 ValueStringBuilder
Then the UTF-8 ValueStringBuilder string should be '<ExpectedValue>'
Examples:
| InitializationType | InitialLength | Start | Length | ExpectedValue |
| Span | 10 | 0 | 11 | HelloWorld! |
| Capacity | 10 | 0 | 11 | HelloWorld! |
| Span | 20 | 0 | 11 | HelloWorld! |
| Capacity | 20 | 0 | 11 | HelloWorld! |
| Span | 10 | 0 | 0 | |
| Capacity | 10 | 0 | 0 | |
| Span | 20 | 0 | 0 | |
| Capacity | 20 | 0 | 0 | |
| Span | 10 | 5 | 0 | |
| Capacity | 10 | 5 | 0 | |
| Span | 20 | 5 | 0 | |
| Capacity | 20 | 5 | 0 | |
| Span | 10 | 3 | 8 | loWorld! |
| Capacity | 10 | 3 | 8 | loWorld! |
| Span | 20 | 3 | 8 | loWorld! |
| Capacity | 20 | 3 | 8 | loWorld! |
| Span | 10 | 3 | 3 | loW |
| Capacity | 10 | 3 | 3 | loW |
| Span | 20 | 3 | 3 | loW |
| Capacity | 20 | 3 | 3 | loW |
| Span | 10 | 10 | 1 | ! |
| Capacity | 10 | 10 | 1 | ! |
| Span | 20 | 10 | 1 | ! |
| Capacity | 20 | 10 | 1 | ! |
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
Feature: Retrieve a Span from a UTF-8 ValueStringBuilder

Scenario Outline: Retrieve a Span from a UTF-8 ValueStringBuilder
Given a UTF-8 ValueStringBuilder initialized with '<InitializationType>' of length <InitialLength>
And I append 'Hello' to the UTF-8 ValueStringBuilder
And I append 'World!' to the UTF-8 ValueStringBuilder
When I get the Span from the UTF-8 ValueStringBuilder
Then the UTF-8 ValueStringBuilder string should be 'HelloWorld!'
Examples:
| InitializationType | InitialLength |
| Span | 10 |
| Capacity | 10 |
| Span | 11 |
| Capacity | 11 |
| Span | 20 |
| Capacity | 20 |

Scenario Outline: Retrieve a Span with a start position from a UTF-8 ValueStringBuilder
Given a UTF-8 ValueStringBuilder initialized with '<InitializationType>' of length <InitialLength>
And I append 'Hello' to the UTF-8 ValueStringBuilder
And I append 'World!' to the UTF-8 ValueStringBuilder
When I get the Span starting at <Start> from the UTF-8 ValueStringBuilder
Then the UTF-8 ValueStringBuilder string should be '<ExpectedValue>'
Examples:
| InitializationType | InitialLength | Start | ExpectedValue |
| Span | 10 | 0 | HelloWorld! |
| Capacity | 10 | 0 | HelloWorld! |
| Span | 20 | 0 | HelloWorld! |
| Capacity | 20 | 0 | HelloWorld! |
| Span | 10 | 3 | loWorld! |
| Capacity | 10 | 3 | loWorld! |
| Span | 20 | 3 | loWorld! |
| Capacity | 20 | 3 | loWorld! |


Scenario Outline: Retrieve a Span with a start position and length from a UTF-8 ValueStringBuilder
Given a UTF-8 ValueStringBuilder initialized with '<InitializationType>' of length <InitialLength>
And I append 'Hello' to the UTF-8 ValueStringBuilder
And I append 'World!' to the UTF-8 ValueStringBuilder
When I get the Span starting at <Start> with length <Length> from the UTF-8 ValueStringBuilder
Then the UTF-8 ValueStringBuilder string should be '<ExpectedValue>'
Examples:
| InitializationType | InitialLength | Start | Length | ExpectedValue |
| Span | 10 | 0 | 11 | HelloWorld! |
| Capacity | 10 | 0 | 11 | HelloWorld! |
| Span | 20 | 0 | 11 | HelloWorld! |
| Capacity | 20 | 0 | 11 | HelloWorld! |
| Span | 10 | 0 | 0 | |
| Capacity | 10 | 0 | 0 | |
| Span | 20 | 0 | 0 | |
| Capacity | 20 | 0 | 0 | |
| Span | 10 | 5 | 0 | |
| Capacity | 10 | 5 | 0 | |
| Span | 20 | 5 | 0 | |
| Capacity | 20 | 5 | 0 | |
| Span | 10 | 3 | 8 | loWorld! |
| Capacity | 10 | 3 | 8 | loWorld! |
| Span | 20 | 3 | 8 | loWorld! |
| Capacity | 20 | 3 | 8 | loWorld! |
| Span | 10 | 3 | 3 | loW |
| Capacity | 10 | 3 | 3 | loW |
| Span | 20 | 3 | 3 | loW |
| Capacity | 20 | 3 | 3 | loW |
| Span | 10 | 10 | 1 | ! |
| Capacity | 10 | 10 | 1 | ! |
| Span | 20 | 10 | 1 | ! |
| Capacity | 20 | 10 | 1 | ! |
Loading
Loading