public CarrierCommandGame(Guid id, GameSettingsController settingsController) : base( id, new CarrierCommandSettings(id, new CarrierCommandStartupParmeters(DefaultStartupParameters), settingsController)) { }
public Homeworld2Game(Guid id, GameSettingsController settingsController) : this( id, new Homeworld2Settings(id, new Homeworld2StartupParameters(DefaultStartupParameters), settingsController) ) { }
public Arma2CoSettings(Guid gameId, ArmaStartupParams startupParameters, GameSettingsController controller, ArmaSettings arma2Settings, Arma2FreeSettings arma2FreeSettings) : base(gameId, startupParameters, controller) { Arma2Original = arma2Settings; Arma2Free = arma2FreeSettings; }
public Arma2COGame(Guid id, GameSettingsController settingsController, Arma2Game arma2Game, Arma2FreeGame arma2FreeGame) : this( id, new Arma2CoSettings(id, new ArmaStartupParams(DefaultStartupParameters), settingsController, arma2Game.Settings, arma2FreeGame.Settings)) { _arma2FreeGame = arma2FreeGame; _arma2Game = arma2Game; }
public Arma2FreeSettings(Guid gameId, ArmaStartupParams startupParameters, GameSettingsController controller) : base(gameId, startupParameters, controller) { StartupParameters = startupParameters; if (ServerFilter == null) { ServerFilter = new ArmaServerFilter(); } }
public void SetUp() { var gsc = new GameSettingsController(); _gameo = new Arma2Game(Guid.NewGuid(), gsc); _settingso = _gameo.Settings; _settingso.Directory = @"C:\temp".ToAbsoluteDirectoryPath(); _game = new Arma2COGame(Guid.NewGuid(), gsc, _gameo, A.Fake<Arma2FreeGame>()); _settings = _game.Settings; _settings.Directory = @"C:\temp".ToAbsoluteDirectoryPath(); }
public void Controller_GameSettings_Read_No_Id_Should_Return_Default_Model() { // Arrange var controller = new GameSettingsController(); // Act var result = controller.Read(); // Assert Assert.IsNotNull(result, TestContext.TestName); }
public void Controller_GameSettings_Instantiate_Default_Should_Pass() { // Arrange var controller = new GameSettingsController(); // Act var result = controller.GetType(); // Assert Assert.AreEqual(result, new GameSettingsController().GetType(), TestContext.TestName); }
public void Controller_GameSettings_Post_Update_Null_Data_Should_Return_Error() { // Arrange var controller = new GameSettingsController(); // Act var result = (RedirectToRouteResult)controller.Update((GameModel)null); // Assert Assert.AreEqual("Error", result.RouteValues["action"], TestContext.TestName); }
public void SetUp() { var gsc = new GameSettingsController(); _gameo = new Arma2Game(Guid.NewGuid(), gsc); _settingso = _gameo.Settings; _settingso.Directory = @"C:\temp".ToAbsoluteDirectoryPath(); _game = new Arma2COGame(Guid.NewGuid(), gsc, _gameo, A.Fake <Arma2FreeGame>()); _settings = _game.Settings; _settings.Directory = @"C:\temp".ToAbsoluteDirectoryPath(); }
public void Controller_GameSettings_Read_Invalid_Id_Should_Return_Error_Page() { // Arrange var controller = new GameSettingsController(); string id = "bogus"; // Act var result = (RedirectToRouteResult)controller.Read(id); // Assert Assert.AreEqual("Error", result.RouteValues["action"], TestContext.TestName); Assert.AreEqual("Home", result.RouteValues["controller"], TestContext.TestName); }
public ArmaSettings(Guid gameId, ArmaStartupParams startupParameters, GameSettingsController controller) : base(gameId, startupParameters, controller) { StartupParameters = startupParameters; if (ServerFilter == null) ServerFilter = new ArmaServerFilter(); this.WhenAnyValue(x => x.ModDirectory) .Where(x => RepositoryDirectory == null && x != null) .Subscribe(x => { RepositoryDirectory = x; }); this.WhenAnyValue(x => x.DefaultModDirectory) .Where(x => ModDirectory == null && x != null) .Subscribe(x => { ModDirectory = x; }); }
public void Controller_GameSettings_Post_Update_Invalid_Model_Should_Send_Back_For_Edit() { // Arrange var controller = new GameSettingsController(); var data = new GameModel(); // Make ModelState Invalid controller.ModelState.AddModelError("test", "test"); // Act ViewResult result = (ViewResult)controller.Update(data); // Assert Assert.IsNotNull(result, TestContext.TestName); }
public void Controller_GameSettings_Update_Get_Default_Should_Pass() { // Arrange var controller = new GameSettingsController(); string id = DataSourceBackend.Instance.GameBackend.GetDefault().Id; // Act var result = (ViewResult)controller.Update(id); // Reset DataSourceBackend.Instance.Reset(); // Assert Assert.IsNotNull(result, TestContext.TestName); }
public void Controller_GameSettings_Post_Update_Empty_Id_Should_Send_Back_For_Edit() { // Arrange var controller = new GameSettingsController(); GameModel dataEmpty = new GameModel { // Make data.Id empty Id = "" }; // Act var resultEmpty = (ViewResult)controller.Update(dataEmpty); // Assert Assert.IsNotNull(resultEmpty, TestContext.TestName); }
public void Controller_GameSettings_Post_Update_Null_Id_Should_Send_Back_For_Edit() { // Arrange var controller = new GameSettingsController(); GameModel dataNull = new GameModel { // Make data.Id = null Id = null }; // Act var resultNull = (ViewResult)controller.Update(dataNull); // Assert Assert.IsNotNull(resultNull, TestContext.TestName); }
public ArmaSettings(Guid gameId, ArmaStartupParams startupParameters, GameSettingsController controller) : base(gameId, startupParameters, controller) { StartupParameters = startupParameters; if (ServerFilter == null) { ServerFilter = new ArmaServerFilter(); } this.WhenAnyValue(x => x.ModDirectory) .Where(x => RepositoryDirectory == null && x != null) .Subscribe(x => { RepositoryDirectory = x; }); this.WhenAnyValue(x => x.DefaultModDirectory) .Where(x => ModDirectory == null && x != null) .Subscribe(x => { ModDirectory = x; }); }
public void Controller_GameSettings_Post_Update_Default_Should_Return_Admin_Settings_Page() { // Arrange var controller = new GameSettingsController(); // Get default GameModel GameModel GameModel = DataSourceBackend.Instance.GameBackend.GetDefault(); // Act var result = (RedirectToRouteResult)controller.Update(GameModel); // Reset DataSourceBackend.Instance.Reset(); // Assert Assert.AreEqual("Settings", result.RouteValues["action"], TestContext.TestName); Assert.AreEqual("Admin", result.RouteValues["controller"], TestContext.TestName); }
protected GameSettings(Guid gameId, GameStartupParameters sp, GameSettingsController controller) { _gameId = gameId; _controller = controller; StartupParameters = sp; controller.Register(gameId, this); if (StartupLine != null) { sp.Parse(StartupLine); } StartupParameters.WhenAnyValue(x => x.StartupLine) .Subscribe(x => StartupLine = x); this.WhenAnyValue(x => x.DefaultDirectory) .Where(x => Directory == null && x != null) .Subscribe(x => { Directory = x; }); }
void OnDeserialized(StreamingContext context) { if (_gameSettings == null) { _gameSettings = new List <LegacyGameSettings>(); } if (_gameSetSettings == null) { _gameSetSettings = new List <LegacyGameSetSettings>(); } if (_gameSettingsController == null) { _gameSettingsController = new GameSettingsController(); } if (_steamDirectory != null && !_steamDirectory.IsValidAbsoluteDirectoryPath()) { _steamDirectory = null; } }
public DayZSettings(Guid gameId, DayZStartupParams sp, GameSettingsController controller) : base(gameId, sp, controller) { Filter = new ArmaServerFilter(); }
public Homeworld2Settings(Guid gameId, Homeworld2StartupParameters startupParameters, GameSettingsController controller) : base(gameId, startupParameters, controller) { StartupParameters = startupParameters; }
protected ArmaGame(Guid id, GameSettingsController settingsController) : this(id, new ArmaSettings(id, new ArmaStartupParams(DefaultStartupParameters), settingsController)) {}
public GTAGameSettings(Guid gameId, GTAStartupParameters sp, GameSettingsController controller) : base(gameId, sp, controller) { }
public GTAGameSettings(Guid gameId, GTAStartupParameters sp, GameSettingsController controller) : base(gameId, sp, controller) {}
protected RealVirtualitySettings(Guid gameId, RealVirtualityStartupParameters startupParameters, GameSettingsController controller) : base(gameId, startupParameters, controller) { StartupParameters = startupParameters; }
public Arma2OaGame(Guid id, GameSettingsController settingsController) : this(id, new Arma2OaSettings(id, new ArmaStartupParams(DefaultStartupParameters), settingsController)) { }
public Arma2OaSettings(Guid gameId, ArmaStartupParams startupParameters, GameSettingsController controller) : base(gameId, startupParameters, controller) { }
void OnDeserialized(StreamingContext context) { if (_gameSettings == null) _gameSettings = new List<LegacyGameSettings>(); if (_gameSetSettings == null) _gameSetSettings = new List<LegacyGameSetSettings>(); if (_gameSettingsController == null) _gameSettingsController = new GameSettingsController(); }
public CarrierCommandSettings(Guid gameId, CarrierCommandStartupParmeters sp, GameSettingsController controller) : base(gameId, sp, controller) { StartupParameters = sp; }
void OnDeserialized(StreamingContext context) { if (_gameSettings == null) _gameSettings = new List<LegacyGameSettings>(); if (_gameSetSettings == null) _gameSetSettings = new List<LegacyGameSetSettings>(); if (_gameSettingsController == null) _gameSettingsController = new GameSettingsController(); if (_steamDirectory != null && !_steamDirectory.IsValidAbsoluteDirectoryPath()) _steamDirectory = null; }
public Arma2FreeSettings(Guid gameId, ArmaStartupParams startupParameters, GameSettingsController controller) : base(gameId, startupParameters, controller) { StartupParameters = startupParameters; if (ServerFilter == null) ServerFilter = new ArmaServerFilter(); }
public TakeOnMarsSettings(Guid gameId, TakeOnMarsStartupParams sp, GameSettingsController controller) : base(gameId, sp, controller) { StartupParameters = sp; }
public Arma1Game(Guid id, GameSettingsController settingsController) : base(id, settingsController) {}
public KerbalSPSettings(Guid gameId, KerbalSPStartupParameters sp, GameSettingsController controller) : base(gameId, sp, controller) { StartupParameters = sp; }
public KerbalSPGame(Guid id, GameSettingsController settingsController) : base(id, new KerbalSPSettings(id, new KerbalSPStartupParameters(), settingsController)) { }
public Arma2OaSettings(Guid gameId, ArmaStartupParams startupParameters, GameSettingsController controller) : base(gameId, startupParameters, controller) {}
public Arma3Game(Guid id, GameSettingsController settingsController, AllInArmaGames aiaGames) : this( id, new Arma3Settings(id, new Arma3StartupParameters(DefaultStartupParameters), settingsController), aiaGames) {}
public GameContext(UserSettings settings) { _gameSettingsController = settings.GameOptions.GameSettingsController; _games = new Lazy <InMemoryDbSet <Game, Guid> >(CreateDbSet); _mods = new Lazy <InMemoryDbSet <Mod, Guid> >(() => CreateDbSet(new ReactiveList <Mod>())); _localMissionsContainers = new Lazy <ReactiveList <LocalMissionsContainer> >(() => { var src = settings.MissionOptions.LocalMissions; lock (src) { var source = new ReactiveList <LocalMissionsContainer>(src); foreach (var lm in source) { lm.Game = Games.Find(lm.GameId); } source.KeepCollectionInSync(src); return(source); } }); _localModsContainers = new Lazy <ReactiveList <LocalModsContainer> >(() => { var src = settings.ModOptions.LocalMods; lock (src) { var source = new ReactiveList <LocalModsContainer>(src); foreach (var lm in source) { lm.Game = Games.Find(lm.GameId); } source.KeepCollectionInSync(src); return(source); } }); _customRepositories = new Lazy <ReactiveList <SixRepo> >(() => { var src = settings.ModOptions.Repositories; lock (src) { var source = new ReactiveList <SixRepo>(src.Values); source.TrackChanges(x => { lock (src) src[x.Uri.ToString()] = x; }, x => { lock (src) src.Remove(x.Uri.ToString()); }, reset => { lock (src) { foreach (var r in reset) { src[r.Uri.ToString()] = r; } foreach (var r in src.Where(x => !reset.Contains(x.Value))) { src.Remove(r.Key); } } }); //source.KeepCollectionInSync(settings.ModOptions.Repositories.Values); return(source); } }); _missions = new Lazy <InMemoryDbSet <Mission, Guid> >( () => { var set = CreateDbSet(new ReactiveList <Mission>()); ProcessMissions(set); return(set); }); _collections = new Lazy <InMemoryDbSet <Collection, Guid> >( () => { var set = CreateDbSet(new ReactiveList <Collection>()); ProcessCollections(set); return(set); }); _customCollections = new Lazy <InMemoryDbSet <CustomCollection, Guid> >( () => { var src = settings.ModOptions.CustomCollections; lock (src) { var customCollectionsSource = new ReactiveList <CustomCollection>(src); customCollectionsSource.KeepCollectionInSync(src); var set = CreateDbSet(customCollectionsSource); ProcessCollections(set); return(set); } }); _subscribedCollections = new Lazy <InMemoryDbSet <SubscribedCollection, Guid> >( () => { var src = settings.ModOptions.SubscribedCollections; lock (src) { var subscribedCollectionsSource = new ReactiveList <SubscribedCollection>(src); subscribedCollectionsSource.KeepCollectionInSync(src); var set = CreateDbSet(subscribedCollectionsSource); ProcessCollections(set); return(set); } }); }
public Arma3Settings(Guid gameId, Arma3StartupParameters startupParameters, GameSettingsController controller) : base(gameId, startupParameters, controller) { StartupParameters = startupParameters; }
public Arma3Game(Guid id, GameSettingsController settingsController, AllInArmaGames aiaGames) : this( id, new Arma3Settings(id, new Arma3StartupParameters(DefaultStartupParameters), settingsController), aiaGames) { }
public TakeOnHelicoptersGame(Guid id, GameSettingsController settingsController) : base(id, settingsController) {}
public GTAIVGame(Guid id, GameSettingsController settingsController) : base(id, new _Settings(id, new _StartupParameters(), settingsController)) { }
public DayZGame(Guid id, GameSettingsController settingsController) : this(id, new DayZSettings(id, new DayZStartupParams(DefaultStartupParameters), settingsController)) {}
public GTAIVSettings(Guid gameId, _StartupParameters sp, GameSettingsController controller) : base(gameId, sp, controller) { StartupParameters = sp; }
public Arma2FreeGame(Guid id, GameSettingsController settingsController) : this(id, new Arma2FreeSettings(id, new ArmaStartupParams(DefaultStartupParameters), settingsController)) {}
public Arma2Game(Guid id, GameSettingsController settingsController) : base(id, settingsController) { }