public void Setup() { // Make fresh copies for each test _fakeRoulette = Substitute.For <IRoulette>(); _fakeOutput = Substitute.For <IOutput>(); _uut = new RouletteGame.Game.Game(_fakeRoulette, _fakeOutput); }
public void Setup() { // Arrange _roulette = Substitute.For <IRoulette>(); _uut = new RouletteGame(_roulette); _roulette.GetResult().Returns(new Field(4, Field.Black)); }
public RouletteController(IRoulette _Roullete, IRedisCache _IRedisCache, IConfiguration _IConfiguration) { _Roulette = _Roullete; _RedisCache = _IRedisCache; _Configuration = _IConfiguration; _ExpirationTime = TimeSpan.FromSeconds(Convert.ToInt32(_Configuration["RedisConfig:ExpirationTime"])); }
public BetServices(IComponentContext components) { this.components = components; rouletteRepository = components.Resolve <IRoulette>(); betRepository = components.Resolve <IBet>(); playerRepository = components.Resolve <IPlayer>(); }
public void ModifyRoulette(IRoulette newRoulette) { var filter = Builders <RouletteDocument> .Filter.Eq("RouletteId", newRoulette.GetId()); var update = Builders <RouletteDocument> .Update.Set("State", (int)newRoulette.GetState()); rouletteContext.Roulettes.UpdateOne(filter, update); }
public void Setup() { _roulette = Substitute.For <IRoulette>(); _uut = new RouletteGame(_roulette); _roulette.GetResult().Returns(new Field(2, Field.Black)); _fieldBet = Substitute.For <IFieldBet>(); _fieldBet.PlayerName.Returns("TestPlayer"); }
public override Task <IRoulette> CreateAsync(IRoulette entity) { return(Task.Run(() => { Redis.SaveObject(entity); return entity; })); }
public servicesRepository(IDBAcces dbAccess) { BetRoulette = new betRouletteBusinnes(dbAccess); Roulette = new rouletteBusinnes(dbAccess); openingClousingRoulete = new openingClousingRouleteBusinnes(dbAccess); betRouletteXColour = new betRouletteXColourBusinnes(dbAccess); betRouletteXNumber = new betRouletteXNumberBusinnes(dbAccess); }
public void CreateNewRoulette(IRoulette newRoulette) { var roulette = new RouletteDocument { RouletteId = newRoulette.GetId(), State = (int)newRoulette.GetState() }; rouletteContext.Roulettes.InsertOne(roulette); }
private void SerializeData(IRoulette roulette) { // Set the path to the file and write it, overwriting the previous file if it exists. var path = RouletteGamePath; using var file = File.CreateText(path); var serializer = new JsonSerializer(); serializer.Serialize(file, roulette); }
public void createMockObject() { Mock <IRoulette> mockRoulette = new Mock <IRoulette>(); roulette = mockRoulette.Object; mockRoulette.Setup(r => r.Spin()).Returns(7); Mock <IGambler> mockGambler = new Mock <IGambler>(); gambler = mockGambler.Object; }
public void SpinRouletteTest() { Mock <IRoulette> mockRoulette = new Mock <IRoulette>(); IRoulette roulette = mockRoulette.Object; mockRoulette.Setup(r => r.Spin()).Returns(7); Croupier croupier = new Croupier(roulette); croupier.spinRoulette(); Assert.IsTrue(croupier.getRouletteNumber() == 7); }
public Roulette(string path) { GameDataPath = path; RouletteGamePath = GameDataPath + "/roulette.json"; if (!File.Exists(RouletteGamePath)) { File.Create(RouletteGamePath).Close(); RouletteGame = new IRoulette { Round = Rand.Next(0, 6), Players = new List <Player>(), Played = new List <Int64>() }; } else { RouletteGame = LoadRoulette(); } }
public Croupier(IRoulette roulette) { this.roulette = roulette; }
public void Init() { roulette = Substitute.For <IRoulette>(); uut = new Library.RouletteGame(roulette); }
public RouletteNumerator(IRoulette roulette) { this._roulette = roulette; }
public RouletteController(IRoulette _roulette) { this.roulette = _roulette; }
public RouletteGame(IRoulette roulette, IConsoleWriter consoleWriter) { _bets = new List <IBet>(); _consoleWriter = consoleWriter; _roulette = roulette; }
/// <summary> /// Constructor /// </summary> /// <param name="roulette">Set by mocking tool</param> public GamesController(IRoulette roulette) { _rouletteGame = roulette; }
public RouletteGame(IRoulette roulette, IOutputDevice outputDevice) { _bets = new List<IBet>(); _roulette = roulette; _outputDevice = outputDevice; }
public RouletteController(IDataAccess client, IRoulette domain) { domain.GetDataAccess(client); _domain = domain; }
public RouletteGame(IRoulette roulette) { _bets = new List<Bet>(); _roulette = roulette; }
public RouletteGame(IRoulette roulette, List <IBet> bets) { _bets = bets; _roulette = roulette; }
public Roulettespil(IRoulette roulette) { _bets = new List <IBet>(); _roulette = roulette; }
public RouletteGame(IRoulette roulette) { _bets = new List <Bet>(); _roulette = roulette; }
public RouletteServices(IComponentContext components) { this.components = components; rouletteRepository = components.Resolve <IRoulette>(); }
public Game(IRoulette roulette, IOutput output) { _bets = new List <IBet>(); _roulette = roulette; _output = output; }
public RouletteGame(IRoulette roulette) { _bets = new List<IBet>(); _roulette = roulette; uiOutput = new ConsoleUI(); }
public RouletteGame(IRoulette roulette, IOutputDevice outputDevice) { _bets = new List <IBet>(); _roulette = roulette; _outputDevice = outputDevice; }
public RouletteGame(IRoulette roulette, UI output) { _bets = new List<IBet>(); _roulette = roulette; uiOutput = output; }