Console.WriteLine("Testing If Elses")
Console.WriteLine("=========")
DoTest(AddressOf TestLoss)
Console.WriteLine("Testing explicit ElseIf")
Console.WriteLine("=========")
DoTest(AddressOf TestLossWithExplicitElse)
Private Sub DoTest(testMethod As Action(Of Loss))
Console.Write("Trying True: ")
testMethod(New Loss With { .ContinueToPaySalary = True })
Console.Write("Trying False: ")
testMethod(New Loss With { .ContinueToPaySalary = False })
Console.Write("Trying Nothing: ")
testMethod(New Loss With { .ContinueToPaySalary = Nothing })
Private Sub TestLoss(CompLoss As Loss)
If CompLoss.ContinueToPaySalary = 1 Then
Console.WriteLine("Executed If")
Console.WriteLine("Executed Else")
Private Sub TestLossWithExplicitElse(CompLoss As Loss)
If CompLoss.ContinueToPaySalary = 1 Then
Console.WriteLine("Executed If")
ElseIf CompLoss.ContinueToPaySalary = 0 Then
Console.WriteLine("Executed Else If")
Console.WriteLine("Executed Else")
Public Property ContinueToPaySalary As Boolean