public virtual void ShouldFailWithNotSupportedCaseException(bool A, bool B, bool C) { Input input = new Input { A = A, B = B, C = C }; Assert.Throws <NotSupportedCaseException>(() => BaseFactory.Create(RuleType).GetOutput(input)); }
public virtual void ShouldSelectCorrectLetter(bool A, bool B, bool C, HType expected) { Input input = new Input { A = A, B = B, C = C }; Output output = BaseFactory.Create(RuleType).GetOutput(input); Assert.Equal(expected, output.H); }
public MainWindow() { InitializeComponent(); InitializeUserInputActions(); _gameSession = BaseFactory.Create <GameSessionFactory, GameSession>(); _gameSession.OnMessageRaised += OnGameMessageRaised; DataContext = _gameSession; }
public ActionResult <object> Post([FromBody] Input input) { try { return(BaseFactory.Create(GetRuleType()).GetOutput(input)); } catch (NotSupportedCaseException exc) { return(BadRequest(exc.ToError())); } }
public static void Main(string[] args) { Program p = BaseFactory.Create <ProgramFactory, Program>(); p.foo = BaseFactory.Create <FooFactory, Foo>(); p.foo.Name = "Hello World!!"; Console.WriteLine(p.foo); p.foo.Name = "Bar"; Console.WriteLine(p.foo); }
protected void ShouldCalculateK(Func <Input> getInput, float D, int E, int F, float expected) { Input input = getInput.Invoke(); input.D = D; input.E = E; input.F = F; Output output = BaseFactory.Create(RuleType).GetOutput(input); Assert.Equal(expected, output.K); }
public GameSession() { CurrentWorld = WorldFactory.CreateWorld(); CurrentPlayer = BaseFactory.Create <PlayerFactory, Player>("Daniel", "Fighter", 0, 10, 10, 1000000); if (!CurrentPlayer.Weapons.Any()) { CurrentPlayer.AddItemToInventory(ItemFactory.CreateGameItem(1001)); } CurrentPlayer.AddItemToInventory(ItemFactory.CreateGameItem(2001)); CurrentPlayer.LearnRecipe(RecipeFactory.RecipeByID(1)); CurrentPlayer.AddItemToInventory(ItemFactory.CreateGameItem(3001)); CurrentPlayer.AddItemToInventory(ItemFactory.CreateGameItem(3002)); CurrentPlayer.AddItemToInventory(ItemFactory.CreateGameItem(3003)); CurrentLocation = CurrentWorld.LocationAt(0, 0); PropertyChanged += OnGamePropertyChanged; OnNewLocation += OnNewLocation_CurrentLocation; OnNewMonster += OnNewMonster_CurrentMonster; }