Skip to content

Commit

Permalink
(build) Corrected databinding tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Windos committed May 13, 2023
1 parent 17c3a7f commit 219d53a
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions tests/Add-BTDataBinding.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,6 @@ Describe 'Add-BTDataBinding' {
$Builder.Content.Visual.BindingGeneric.Children.Text[1].BindingName | Should -BeIn $Builder.DataBinding.Keys
}

It 'adds a text box via the pipeline' {
$Builder = New-BTContentBuilder
Add-BTText -ContentBuilder $Builder -Text 'Heading' -Bindable
Add-BTText -ContentBuilder $Builder -Text 'Body' -Bindable
$Binding = @{
Heading = 'This is the heading'
Body = 'This is the body'
}
Add-BTDataBinding -ContentBuilder $Builder -Hashtable $Binding

# The resulting XML is as expected
$ExpectedXML = '<?xml version="1.0"?><toast><visual><binding template="ToastGeneric"><text>{Heading}</text><text>{Body}</text></binding></visual></toast>'
$Builder.GetXml().GetXml() | Should -BeExactly $ExpectedXML

# Bindable text is found in the bindings
$Builder.Content.Visual.BindingGeneric.Children.Text[0].BindingName | Should -BeIn $Builder.DataBinding.Keys
$Builder.Content.Visual.BindingGeneric.Children.Text[1].BindingName | Should -BeIn $Builder.DataBinding.Keys
}

It 'returns a toast content builder to the pipeline when the PassThru switch is supplied' {
$Builder = New-BTContentBuilder
Add-BTText -ContentBuilder $Builder -Text 'Example' -Bindable -PassThru | Should -BeOfType [Microsoft.Toolkit.Uwp.Notifications.ToastContentBuilder]
Expand Down

0 comments on commit 219d53a

Please sign in to comment.