This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Position WalkNorth() | |
{ | |
var player = GetPlayer(); | |
player.Move("N"); | |
return player.NewPosition; | |
} | |
public Position WalkSouth() | |
{ | |
var player = GetPlayer(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Position Walk(string direction) | |
{ | |
var player = GetPlayer(); | |
player.Move(direction); | |
return player.NewPosition; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public int FindIntMatch(int i) | |
{ | |
var match = (int)container.Get(i); | |
return match; | |
} | |
public string FindStringMatch(string s) | |
{ | |
var match = (string)container.Get(s); | |
return match; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public T FindMatch(T t) | |
{ | |
var match = (T)container.Get(t); | |
return match; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void GoForRun() | |
{ | |
GetDressed(); | |
Run(); | |
Shower(); | |
} | |
public void LiftWeights() | |
{ | |
GetDressed(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void DoFitnessActivity(Action activity) | |
{ | |
GetDressed(); | |
activity(); | |
Shower(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void DoCall() | |
{ | |
ShowProgressDialog(); | |
RemoteService.DoAsync(CallBackMethod); | |
} | |
public void CallBackMethod(Result result) | |
{ | |
HideProgressDialog(); | |
// Process result; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UIServiceCaller.ExecuteAsync(RemoteService.DoAsync, CallBackMethod); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void ExecuteAsync(Action<Action<Result>> asyncMethod, Action callback) | |
{ | |
ShowProgressDialog(); | |
Action wrappedCallback = (r => | |
{ | |
DismissProgressDialog(); | |
callback(r); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var milkShakeMaker = new MilkShakeMaker(); | |
var shake = milkShakeMaker.MakeShake(icecubes, milk, ingredients); | |
public class MileShakeMaker | |
{ | |
public Shake MakeShake(IEnumerable iceCubes, | |
IMilk milk, | |
IEnumerable ingredients) | |
{ | |
if(ice == null || milk == null || ingredient == null) |