@@ -56,7 +56,7 @@ public async void Starting_MultipleJobhostChannels_Succeeds()
56
56
await functionDispatcher . InitializeAsync ( GetTestFunctionsList ( LanguageWorkerConstants . NodeLanguageWorkerName ) ) ;
57
57
58
58
var finalChannelCount = await WaitForJobhostWorkerChannelsToStartup ( functionDispatcher , expectedProcessCount ) ;
59
- Assert . Equal ( finalChannelCount , expectedProcessCount ) ;
59
+ Assert . Equal ( expectedProcessCount , finalChannelCount ) ;
60
60
61
61
// Verify LanguageWorkerChannelState when channel after it is initialized
62
62
Assert . True ( functionDispatcher . WorkerState . GetChannels ( ) . All ( ch => ch . State == LanguageWorkerChannelState . Initialized ) ) ;
@@ -70,46 +70,46 @@ public async void Starting_MultipleWebhostChannels_Succeeds()
70
70
await functionDispatcher . InitializeAsync ( GetTestFunctionsList ( LanguageWorkerConstants . JavaLanguageWorkerName ) ) ;
71
71
72
72
var finalWebhostChannelCount = await WaitForWebhostWorkerChannelsToStartup ( functionDispatcher . ChannelManager , expectedProcessCount , "java" ) ;
73
- Assert . Equal ( finalWebhostChannelCount , expectedProcessCount ) ;
73
+ Assert . Equal ( expectedProcessCount , finalWebhostChannelCount ) ;
74
74
75
75
var finalJobhostChannelCount = functionDispatcher . WorkerState . GetChannels ( ) . Count ( ) ;
76
- Assert . Equal ( finalJobhostChannelCount , 0 ) ;
76
+ Assert . Equal ( 0 , finalJobhostChannelCount ) ;
77
77
}
78
78
79
79
[ Fact ]
80
80
public void MaxProcessCount_Returns_Default ( )
81
81
{
82
82
FunctionDispatcher functionDispatcher = ( FunctionDispatcher ) GetTestFunctionDispatcher ( ) ;
83
- Assert . Equal ( functionDispatcher . MaxProcessCount , 1 ) ;
83
+ Assert . Equal ( 1 , functionDispatcher . MaxProcessCount ) ;
84
84
85
85
functionDispatcher = ( FunctionDispatcher ) GetTestFunctionDispatcher ( "0" ) ;
86
- Assert . Equal ( functionDispatcher . MaxProcessCount , 1 ) ;
86
+ Assert . Equal ( 1 , functionDispatcher . MaxProcessCount ) ;
87
87
88
88
functionDispatcher = ( FunctionDispatcher ) GetTestFunctionDispatcher ( "-1" ) ;
89
- Assert . Equal ( functionDispatcher . MaxProcessCount , 1 ) ;
89
+ Assert . Equal ( 1 , functionDispatcher . MaxProcessCount ) ;
90
90
}
91
91
92
92
[ Fact ]
93
93
public void MaxProcessCount_ProcessCount_Set_Returns_ExpectedCount ( )
94
94
{
95
95
int expectedProcessCount = 3 ;
96
96
FunctionDispatcher functionDispatcher = ( FunctionDispatcher ) GetTestFunctionDispatcher ( expectedProcessCount . ToString ( ) ) ;
97
- Assert . Equal ( functionDispatcher . MaxProcessCount , expectedProcessCount ) ;
97
+ Assert . Equal ( expectedProcessCount , functionDispatcher . MaxProcessCount ) ;
98
98
}
99
99
100
100
[ Fact ]
101
101
public void MaxProcessCount_ProcessCount_Set_ExceedsMax_Returns_ExpectedCount ( )
102
102
{
103
103
int expectedProcessCount = 30 ;
104
104
FunctionDispatcher functionDispatcher = ( FunctionDispatcher ) GetTestFunctionDispatcher ( expectedProcessCount . ToString ( ) ) ;
105
- Assert . Equal ( functionDispatcher . MaxProcessCount , 10 ) ;
105
+ Assert . Equal ( 10 , functionDispatcher . MaxProcessCount ) ;
106
106
}
107
107
108
108
[ Fact ]
109
109
public async void FunctionDispatcherState_Default_DotNetFunctions ( )
110
110
{
111
111
FunctionDispatcher functionDispatcher = ( FunctionDispatcher ) GetTestFunctionDispatcher ( ) ;
112
- Assert . Equal ( functionDispatcher . State , FunctionDispatcherState . Default ) ;
112
+ Assert . Equal ( FunctionDispatcherState . Default , functionDispatcher . State ) ;
113
113
FunctionMetadata func1 = new FunctionMetadata ( )
114
114
{
115
115
Name = "func1" ,
@@ -120,20 +120,20 @@ public async void FunctionDispatcherState_Default_DotNetFunctions()
120
120
func1
121
121
} ;
122
122
await functionDispatcher . InitializeAsync ( functions ) ;
123
- Assert . Equal ( functionDispatcher . State , FunctionDispatcherState . Default ) ;
123
+ Assert . Equal ( FunctionDispatcherState . Default , functionDispatcher . State ) ;
124
124
125
125
await functionDispatcher . InitializeAsync ( functions ) ;
126
- Assert . Equal ( functionDispatcher . State , FunctionDispatcherState . Default ) ;
126
+ Assert . Equal ( FunctionDispatcherState . Default , functionDispatcher . State ) ;
127
127
128
128
await functionDispatcher . InitializeAsync ( functions ) ;
129
- Assert . Equal ( functionDispatcher . State , FunctionDispatcherState . Default ) ;
129
+ Assert . Equal ( FunctionDispatcherState . Default , functionDispatcher . State ) ;
130
130
}
131
131
132
132
[ Fact ]
133
133
public async void FunctionDispatcherState_Default_NoFunctions ( )
134
134
{
135
135
FunctionDispatcher functionDispatcher = ( FunctionDispatcher ) GetTestFunctionDispatcher ( ) ;
136
- Assert . Equal ( functionDispatcher . State , FunctionDispatcherState . Default ) ;
136
+ Assert . Equal ( FunctionDispatcherState . Default , functionDispatcher . State ) ;
137
137
await functionDispatcher . InitializeAsync ( new List < FunctionMetadata > ( ) ) ;
138
138
}
139
139
@@ -142,7 +142,7 @@ public async void ShutdownChannels_NoFunctions()
142
142
{
143
143
var mockLanguageWorkerChannelManager = new Mock < ILanguageWorkerChannelManager > ( ) ;
144
144
FunctionDispatcher functionDispatcher = ( FunctionDispatcher ) GetTestFunctionDispatcher ( mockLanguageWorkerChannelManager : mockLanguageWorkerChannelManager ) ;
145
- Assert . Equal ( functionDispatcher . State , FunctionDispatcherState . Default ) ;
145
+ Assert . Equal ( FunctionDispatcherState . Default , functionDispatcher . State ) ;
146
146
await functionDispatcher . InitializeAsync ( new List < FunctionMetadata > ( ) ) ;
147
147
// Wait longer than debouce action.
148
148
await Task . Delay ( 6000 ) ;
@@ -163,7 +163,7 @@ public async void ShutdownChannels_DotNetFunctions()
163
163
} ;
164
164
var mockLanguageWorkerChannelManager = new Mock < ILanguageWorkerChannelManager > ( ) ;
165
165
FunctionDispatcher functionDispatcher = ( FunctionDispatcher ) GetTestFunctionDispatcher ( mockLanguageWorkerChannelManager : mockLanguageWorkerChannelManager ) ;
166
- Assert . Equal ( functionDispatcher . State , FunctionDispatcherState . Default ) ;
166
+ Assert . Equal ( FunctionDispatcherState . Default , functionDispatcher . State ) ;
167
167
await functionDispatcher . InitializeAsync ( functions ) ;
168
168
// Wait longer than debouce action.
169
169
await Task . Delay ( 6000 ) ;
@@ -184,7 +184,7 @@ public async void FunctionDispatcherState_Transitions_From_Starting_To_Initializ
184
184
func1
185
185
} ;
186
186
await functionDispatcher . InitializeAsync ( functions ) ;
187
- Assert . Equal ( functionDispatcher . State , FunctionDispatcherState . Initializing ) ;
187
+ Assert . True ( functionDispatcher . State == FunctionDispatcherState . Initializing || functionDispatcher . State == FunctionDispatcherState . Initialized ) ;
188
188
await WaitForFunctionDispactherStateInitialized ( functionDispatcher ) ;
189
189
}
190
190
0 commit comments