@@ -53,10 +53,10 @@ public void WaitFunctionNumberThrowsOnInvalidArgumentsTest()
53
53
var recordType = RecordType . Empty ( ) . Add ( "Text" , FormulaType . Number ) ;
54
54
var waitFunction = new WaitFunctionNumber ( Timeout , MockLogger . Object ) ;
55
55
var recordValue = new ControlRecordValue ( recordType , MockPowerAppFunctions . Object , "Label1" ) ;
56
- Assert . Throws < ArgumentNullException > ( ( ) => waitFunction . Execute ( null , FormulaValue . New ( "Text" ) , FormulaValue . New ( 1 ) ) ) ;
57
- Assert . Throws < ArgumentNullException > ( ( ) => waitFunction . Execute ( new SomeOtherRecordValue ( recordType ) , null , FormulaValue . New ( 1 ) ) ) ;
56
+ Assert . Throws < ArgumentNullException > ( ( ) => waitFunction . Execute ( null , FormulaValue . New ( "Text" ) , FormulaValue . New ( 1d ) ) ) ;
57
+ Assert . Throws < ArgumentNullException > ( ( ) => waitFunction . Execute ( new SomeOtherRecordValue ( recordType ) , null , FormulaValue . New ( 1d ) ) ) ;
58
58
Assert . Throws < ArgumentNullException > ( ( ) => waitFunction . Execute ( new SomeOtherRecordValue ( recordType ) , FormulaValue . New ( "Text" ) , null ) ) ;
59
- Assert . Throws < InvalidCastException > ( ( ) => waitFunction . Execute ( new SomeOtherRecordValue ( recordType ) , FormulaValue . New ( "Text" ) , FormulaValue . New ( 1 ) ) ) ;
59
+ Assert . Throws < InvalidCastException > ( ( ) => waitFunction . Execute ( new SomeOtherRecordValue ( recordType ) , FormulaValue . New ( "Text" ) , FormulaValue . New ( 1d ) ) ) ;
60
60
}
61
61
62
62
[ Fact ]
@@ -141,13 +141,13 @@ public void WaitFunctionImproperValueForStringTest()
141
141
public void WaitFunctionNumberSucceedsTest ( )
142
142
{
143
143
LoggingTestHelper . SetupMock ( MockLogger ) ;
144
- var valueToWaitFor = 1 ;
144
+ var valueToWaitFor = 1d ;
145
145
var recordType = RecordType . Empty ( ) . Add ( "Text" , FormulaType . Number ) ;
146
146
147
147
var recordValue = new ControlRecordValue ( recordType , MockPowerAppFunctions . Object , "Label1" ) ;
148
148
var jsPropertyValueModel = new JSPropertyValueModel ( )
149
149
{
150
- PropertyValue = valueToWaitFor . ToString ( ) ,
150
+ PropertyValue = valueToWaitFor . ToString ( "G" ) ,
151
151
} ;
152
152
var expectedItemPath = new ItemPath
153
153
{
@@ -159,7 +159,7 @@ public void WaitFunctionNumberSucceedsTest()
159
159
MockTestState . Setup ( x => x . GetTimeout ( ) ) . Returns ( Timeout ) ;
160
160
161
161
var waitFunction = new WaitFunctionNumber ( Timeout , MockLogger . Object ) ;
162
- waitFunction . Execute ( recordValue , FormulaValue . New ( "Text" ) , NumberValue . New ( valueToWaitFor ) ) ;
162
+ waitFunction . Execute ( recordValue , FormulaValue . New ( "Text" ) , FormulaValue . New ( valueToWaitFor ) ) ;
163
163
164
164
MockPowerAppFunctions . Verify ( x => x . GetPropertyValueFromControl < string > ( It . Is < ItemPath > ( ( itemPath ) => itemPath . ControlName == expectedItemPath . ControlName && itemPath . PropertyName == expectedItemPath . PropertyName ) ) , Times . Exactly ( 2 ) ) ;
165
165
}
@@ -185,7 +185,7 @@ public void WaitFunctionImproperValueForNumberTest()
185
185
MockTestState . Setup ( x => x . GetTimeout ( ) ) . Returns ( Timeout ) ;
186
186
187
187
var waitFunction = new WaitFunctionNumber ( Timeout , MockLogger . Object ) ;
188
- Assert . Throws < InvalidDataException > ( ( ) => waitFunction . Execute ( recordValue , FormulaValue . New ( "Value" ) , NumberValue . New ( 1 ) ) ) ;
188
+ Assert . Throws < InvalidDataException > ( ( ) => waitFunction . Execute ( recordValue , FormulaValue . New ( "Value" ) , FormulaValue . New ( 1d ) ) ) ;
189
189
}
190
190
191
191
[ Fact ]
@@ -405,7 +405,7 @@ public void WaitFunctionStringWaitsForValueToUpdateTest()
405
405
public void WaitFunctionNumberWaitsForValueToUpdateTest ( )
406
406
{
407
407
LoggingTestHelper . SetupMock ( MockLogger ) ;
408
- var valueToWaitFor = 1 ;
408
+ var valueToWaitFor = 1d ;
409
409
var recordType = RecordType . Empty ( ) . Add ( "Text" , FormulaType . Number ) ;
410
410
var recordValue = new ControlRecordValue ( recordType , MockPowerAppFunctions . Object , "Label1" ) ;
411
411
var jsPropertyValueModel = new JSPropertyValueModel ( )
@@ -414,7 +414,7 @@ public void WaitFunctionNumberWaitsForValueToUpdateTest()
414
414
} ;
415
415
var finalJsPropertyValueModel = new JSPropertyValueModel ( )
416
416
{
417
- PropertyValue = valueToWaitFor . ToString ( ) ,
417
+ PropertyValue = valueToWaitFor . ToString ( "G" ) ,
418
418
} ;
419
419
var expectedItemPath = new ItemPath
420
420
{
@@ -428,7 +428,7 @@ public void WaitFunctionNumberWaitsForValueToUpdateTest()
428
428
MockTestState . Setup ( x => x . GetTimeout ( ) ) . Returns ( Timeout ) ;
429
429
430
430
var waitFunction = new WaitFunctionNumber ( Timeout , MockLogger . Object ) ;
431
- waitFunction . Execute ( recordValue , FormulaValue . New ( "Text" ) , NumberValue . New ( valueToWaitFor ) ) ;
431
+ waitFunction . Execute ( recordValue , FormulaValue . New ( "Text" ) , FormulaValue . New ( valueToWaitFor ) ) ;
432
432
433
433
MockPowerAppFunctions . Verify ( x => x . GetPropertyValueFromControl < string > ( It . Is < ItemPath > ( ( itemPath ) => itemPath . ControlName == expectedItemPath . ControlName && itemPath . PropertyName == expectedItemPath . PropertyName ) ) , Times . Exactly ( 3 ) ) ;
434
434
}
@@ -554,7 +554,7 @@ public void WaitFunctionStringTimeoutTest()
554
554
public void WaitFunctionNumberTimeoutTest ( )
555
555
{
556
556
LoggingTestHelper . SetupMock ( MockLogger ) ;
557
- var valueToWaitFor = 1 ;
557
+ var valueToWaitFor = 1d ;
558
558
var recordType = RecordType . Empty ( ) . Add ( "Text" , FormulaType . Number ) ;
559
559
var recordValue = new ControlRecordValue ( recordType , MockPowerAppFunctions . Object , "Label1" ) ;
560
560
var jsPropertyValueModel = new JSPropertyValueModel ( )
0 commit comments