public void Default_Produces_Unchanged_System_List() { var init = new Initialiser(m_FakeCWB); var hash = GetListHash(DefaultSystems); Assert.AreEqual(hash, GetListHash(init.Initialise(DefaultSystems))); }
public void Untagged_Systems_Stay_In_Default_List() { m_DefaultSystems.Add(typeof(Test1)); var newSystems = new Initialiser(m_FakeCWB).Initialise(m_DefaultSystems); Assert.Contains(typeof(Test1), newSystems); }
public App() { mRoot = new Root(String.Format("plugins-{0}.cfg", GetOS())); Initialiser.SetupResources("resources.cfg"); mRoot.ShowConfigDialog(); mRenderWindow = mRoot.Initialise(true); mSceneManager = mRoot.CreateSceneManager((UInt16)SceneType.Generic, "ExampleSMInstance"); mCamera = mSceneManager.CreateCamera("MainCamera"); mCamera.Position = new Math3D.Vector3(150, 150, 150); mCamera.LookAt(new Math3D.Vector3(0, 0, 0)); mCamera.NearClipDistance = 5; mViewport = mRenderWindow.AddViewport(mCamera); mViewport.BackgroundColor = Color.Blue; mCamera.AspectRatio = (float)mViewport.ActualWidth / (float)mViewport.ActualHeight; TextureManager.Instance.SetDefaultNumMipmaps(5); ResourceGroupManager.getSingleton().initialiseAllResourceGroups(); mSceneManager.AmbientLightColor = Color.FromArgb(125, 125, 125, 125); mSceneManager.SetSkyBox(true, "Examples/SpaceSkyBox", 50); mLight = mSceneManager.CreateLight("MainLight"); mLight.Position = new Math3D.Vector3(20, 80, 50); mEntity = mSceneManager.CreateEntity("razor", "razor.mesh"); mSceneManager.RootSceneNode.AttachObject(mEntity); // TODO: enabling this causes a crash: // mSceneManager.RootSceneNode.CreateChildSceneNode(new Math3D.Vector3(0.0f, 6.5f, -67.0f)).AttachObject(mParticleSystem); }
public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) { // Override point for customization after application launch. // If not required for your application you can safely delete this method Initialiser.Init(); return(true); }
public void Alterations_In_PostInitialize_Are_Returned() { m_FakeCWB.Alterations.Add(typeof(Test1)); var results = new Initialiser(m_FakeCWB).Initialise(m_DefaultSystems); Assert.IsTrue(results.Contains(typeof(Test1))); }
protected override void OneTimeSetup() { base.OneTimeSetup(); m_DefaultSystems.Add(typeof(Test3_InitializationSystem)); m_DefaultSystems.Add(typeof(Test3_SimulationSystem)); m_DefaultSystems.Add(typeof(Test3_PresentationSystem)); var newSystems = new Initialiser(m_FakeCWB).Initialise(m_DefaultSystems); }
public GivenAnInitialiser() { _connectionString = "Host=localhost;Username=postgres;Password=password;Pooling=false;Database=testdatabase;"; _initialiser = new Initialiser(_connectionString); _initialiser.Init(); _sessionFactory = CreateSessionFactory(); }
public async Task WhenErrorFindingSpeaker_ReturnsConferenceApiException(int errorCode, StringContent response, HttpStatusCode statusCode) { ConferenceApiService sut = Initialiser.BuildService(response, statusCode); var result = await Assert.ThrowsAsync <ConferenceApiException>(() => sut.FindSpeaker("Random Speaker")); Assert.Equal(errorCode, (int)result.StatusCode); }
protected override void OneTimeSetup() { base.OneTimeSetup(); m_DefaultSystems.Add(typeof(Test5_Group1)); m_DefaultSystems.Add(typeof(Test5_Group2)); m_DefaultSystems.Add(typeof(Test5_System)); var newSystems = new Initialiser(m_FakeCWB).Initialise(m_DefaultSystems); }
public void TestDiagonalForSquare() { TestingHelper helper = new TestingHelper(); Initialiser bitboards = new Initialiser(); UInt64 diag = bitboards.GetDiagonalForSquare(18); string boardString = helper.BitboardToBoardString(diag); Debug.WriteLine(boardString); }
public void TestNorthRayInitialisation() { Initialiser northRayBitboard = new Initialiser(); UInt64[] northRayBoard = northRayBitboard.InitialiseNorth(); TestingHelper helper = new TestingHelper(); string northRayBoardString = helper.BitboardToBoardString(northRayBoard[55]); Debug.WriteLine(northRayBoardString); }
public void TestAntiDiagonalForSquare() { TestingHelper helper = new TestingHelper(); Initialiser antiDiagsForSquare = new Initialiser(); UInt64 antiDiag = antiDiagsForSquare.GetAntiDiagonalForSquare(63); string boardString = helper.BitboardToBoardString(antiDiag); Debug.WriteLine(boardString); }
private void OnApplicationStarted() { _logger.LogInformation("Creating database."); _dbInitialiser = new Initialiser(Configuration.GetConnectionString("Content")); _dbInitialiser.Init(); _logger.LogInformation("Creating s3 bucket."); _s3Initialiser = new S3Initialiser(Configuration.GetSection("S3Buckets")["Images"]); _s3Initialiser.Init(); }
public void TestEastRayInitialisation() { Initialiser eastRayBitboard = new Initialiser(); UInt64[] eastRayBoard = eastRayBitboard.InitialiseEast(); TestingHelper helper = new TestingHelper(); string eastRayBoardString = helper.BitboardToBoardString(eastRayBoard[0]); Debug.WriteLine(eastRayBoardString); }
public void TestWestRayInitialisation() { Initialiser westRayBitboard = new Initialiser(); UInt64[] westRayBoard = westRayBitboard.InitialiseWest(); TestingHelper helper = new TestingHelper(); string westRayBoardString = helper.BitboardToBoardString(westRayBoard[48]); Debug.WriteLine(westRayBoardString); }
public void TestSouthRayInitialisation() { Initialiser southRayBitboard = new Initialiser(); UInt64[] southRayBoard = southRayBitboard.InitialiseSouth(); TestingHelper helper = new TestingHelper(); string southRayBoardString = helper.BitboardToBoardString(southRayBoard[63]); Debug.WriteLine(southRayBoardString); }
public void BeforeScenario() { var browserName = ConfigurationManager.AppSettings["browserName"]; var applicationUrl = ConfigurationManager.AppSettings["browserUrl"]; DemofwkPagefactory.InitializePages(Initialiser.getDriver(browserName)); Initialiser.Maximize(); Initialiser.Open(applicationUrl); }
public void TestFileRaysInitialisation() { Initialiser fileRayBitboard = new Initialiser(); UInt64[] fileRays = fileRayBitboard.InitialiseFileRays(); TestingHelper helper = new TestingHelper(); string fileRayBoardString = helper.BitboardToBoardString(fileRays[5]); Debug.WriteLine(fileRayBoardString); }
public void TestDiagonalValues() { TestingHelper helper = new TestingHelper(); Initialiser bitboards = new Initialiser(); UInt64[] rankDiags = bitboards.InitialiseRankDiagonals(); UInt64 diag = rankDiags[0] << 18; string boardString = helper.BitboardToBoardString(diag); Debug.WriteLine(boardString); }
// // This method is invoked when the application has loaded and is ready to run. In this // method you should instantiate the window, load the UI into it and then make the window // visible. // // You have 17 seconds to return from this method, or iOS will terminate your application. // public override bool FinishedLaunching(UIApplication app, NSDictionary options) { Initialiser.Init(); Forms.Init(); var ignore = Acr.UserDialogs.UserDialogs.Instance; LoadApplication(new App()); return(base.FinishedLaunching(app, options)); }
public void TestAntiDiagonals() { TestingHelper helper = new TestingHelper(); Initialiser antiDiagsInitialiser = new Initialiser(); UInt64[] fileAntiDiags = antiDiagsInitialiser.InitialiseFileAntiDiagonals(); UInt64 northWestRay = fileAntiDiags[5] >> 7; string antiDiagonalBoardString = helper.BitboardToBoardString(northWestRay); Debug.WriteLine(antiDiagonalBoardString); }
/// <summary> /// Initialises Ogre objects and event handling, loads resources, and calls ExampleApplication.CreateScene(). /// </summary> /// <returns>Returns true if successfull, false if unsuccessfull</returns> /// <remarks>This method should only be called by the user if ExampleApplication.Start() is not called.</remarks> /// <seealso>ExampleApplication.Start</seealso> protected bool Setup() { mRoot = new Root(); Initialiser.SetupResources("resources.cfg"); if (!mRoot.ShowConfigDialog()) { return(false); } mRenderWindow = mRoot.Initialise(true, "Ogre Render Window"); mSceneManager = this.mRoot.GetSceneManager(SceneType.Generic); mCamera = this.mSceneManager.CreateCamera("MainCamera"); mCamera.SetPosition(0, 0, -200); mCamera.LookAt = new Vector3(0, 0, 0); mCamera.NearClipDistance = 5; mViewport = mRenderWindow.AddViewport(mCamera); mViewport.BackgroundColor = Color.Blue; mCamera.AspectRatio = (float)mViewport.ActualWidth / (float)mViewport.ActualHeight; TextureManager.Instance.SetDefaultNumMipmaps(5); ResourceGroupManager.getSingleton().initialiseAllResourceGroups(); mEventHandler = new OgreDotNet.EventHandler(mRoot, mRenderWindow); mEventHandler.SubscribeEvents(); mEventHandler.FrameStarted += new FrameEventDelegate(FrameStarted); mEventHandler.FrameEnded += new FrameEventDelegate(FrameEnded); mEventHandler.KeyClicked += new KeyEventDelegate(KeyClicked); mEventHandler.KeyPressed += new KeyEventDelegate(KeyPressed); mEventHandler.KeyReleased += new KeyEventDelegate(KeyReleased); mEventHandler.MouseMoved += new MouseMotionEventDelegate(MouseMotion); mEventHandler.MouseClicked += new MouseEventDelegate(MouseClick); mEventHandler.MousePressed += new MouseEventDelegate(MousePressed); mEventHandler.MouseReleased += new MouseEventDelegate(MouseReleased); mEventHandler.MouseDragged += new MouseMotionEventDelegate(MouseDragged); InputReader inputreader = mEventHandler.GetInputReader(); mDebugOverlay = OverlayManager.getSingleton().getByName("Core/DebugOverlay"); mAverageFPS = OverlayManager.getSingleton().getOverlayElement("Core/AverageFps"); mCurrentFPS = OverlayManager.getSingleton().getOverlayElement("Core/CurrFps"); mBestFPS = OverlayManager.getSingleton().getOverlayElement("Core/BestFps"); mWorstFPS = OverlayManager.getSingleton().getOverlayElement("Core/WorstFps"); mTriangleCount = OverlayManager.getSingleton().getOverlayElement("Core/NumTris"); DebugOverlayVisible = true; MaterialManager.Instance.SetDefaultTextureFiltering(mFilter); MaterialManager.Instance.SetDefaultAnisotropy(mAnisotropy); CreateScene(); return(true); }
protected override void OnCreate(Bundle savedInstanceState) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(savedInstanceState); Initialiser.Init(this, savedInstanceState); Forms.Init(this, savedInstanceState); LoadApplication(new App()); }
public void ForwardValueFlow_2Layers() { Model model = new Model(1, ActivationType.ReLU, 1, ActivationType.ReLU, CostType.Abs); model.FirstInputValue = 4; Initialiser.InitWithConstValue(model[0].Weights.Primal, 1); Initialiser.InitWithConstValue(model[1].Weights.Primal, 2); model.ForwardPass(new Matrix(0)); Assert.AreEqual(8, model.FirstOutputValue); }
public App(Control control) { mRoot = new Root(String.Format("plugins-{0}.cfg", GetOS())); Initialiser.SetupResources("resources.cfg"); mRoot.ShowConfigDialog(); mRenderWindow = mRoot.Initialise(control); mSceneManager = mRoot.CreateSceneManager((UInt16)SceneType.Generic, "ExampleSMInstance"); mCamera = mSceneManager.CreateCamera("MainCamera"); mCamera.Position = new Math3D.Vector3(150, 150, 150); mCamera.LookAt(new Math3D.Vector3(0, 0, 0)); mCamera.NearClipDistance = 5; mViewport = mRenderWindow.AddViewport(mCamera); mViewport.BackgroundColor = Color.Blue; mCamera.AspectRatio = (float)mViewport.ActualWidth / (float)mViewport.ActualHeight; TextureManager.Instance.SetDefaultNumMipmaps(5); ResourceGroupManager.getSingleton().initialiseAllResourceGroups(); mSceneManager.AmbientLightColor = Color.FromArgb(125, 125, 125, 125); mSceneManager.SetSkyBox(true, "Examples/SpaceSkyBox", 50); mLight = mSceneManager.CreateLight("MainLight"); mLight.Position = new Math3D.Vector3(20, 80, 50); mEntity = mSceneManager.CreateEntity("razor", "razor.mesh"); mSceneManager.RootSceneNode.AttachObject(mEntity); mParticleSystem = mSceneManager.CreateParticleSystem("ParticleSys1", 200); mParticleSystem.MaterialName = "Examples/Flare"; mParticleSystem.SetDefaultDimensions(25, 25); mParticleEmitter1 = mParticleSystem.AddEmitter("Point"); mParticleEmitter1.TimeToLive = 0.2f; mParticleEmitter1.EmissionRate = 70.0f; mParticleEmitter1.ParticleVelocity = 100.0f; mParticleEmitter1.Direction = new Math3D.Vector3(0.0f, 0.0f, -1.0f); mParticleEmitter1.SetColors(Color.White, Color.Red); mParticleEmitter1.Position = new Math3D.Vector3(5.7f, 0.0f, 0.0f); mParticleEmitter2 = mParticleSystem.AddEmitter("Point"); mParticleEmitter2.TimeToLive = 0.2f; mParticleEmitter2.EmissionRate = 70.0f; mParticleEmitter2.ParticleVelocity = 100.0f; mParticleEmitter2.Direction = new Math3D.Vector3(0.0f, 0.0f, -1.0f); mParticleEmitter2.SetColors(Color.White, Color.Red); mParticleEmitter2.Position = new Math3D.Vector3(-18.0f, 0.0f, 0.0f); mSceneManager.RootSceneNode.CreateChildSceneNode(new Math3D.Vector3(0.0f, 6.5f, -67.0f)).AttachObject(mParticleSystem); }
public GenericTHingyMahig(Initialiser <T> init, int quantity = 3) { if (quantity >= 0) { items = new T[quantity]; for (int i = 0; i < quantity; i++) { items[i] = init(); } } _quantity = quantity; }
public async Task WhenSpeakerNotFound_ReturnsNull() { const string NAME_TO_SEARCH = "Scott Guthriex"; var opts = Initialiser.ConferenceApiConfig(); var clientFactoryForSpeakers = Initialiser.ConferenceClientFactory(ConferenceApiResponses.SpeakersResponse); var sut = new ConferenceApiService(opts, clientFactoryForSpeakers); var result = await sut.FindSpeaker(NAME_TO_SEARCH); //, new DateTime(2013,12,04,11,10,00) Assert.Null(result); }
public void Load() { foreach (string ext in extpoints) { log.Info("[Plugins]: Loading extension point " + ext); if (constraints.ContainsKey(ext)) { IPluginConstraint cons = constraints[ext]; if (cons.Apply(ext)) { log.Error("[Plugins]: " + ext + " failed constraint: " + cons.Message); } } IPluginFilter filter = null; if (filters.ContainsKey(ext)) { filter = filters[ext]; } List <T> loadedPlugins = new List <T>(); foreach (PluginExtensionNode node in AddinManager.GetExtensionNodes(ext)) { log.Info("[Plugins]: Trying plugin " + node.Path); if ((filter != null) && (filter.Apply(node) == false)) { continue; } T plugin = (T)node.CreateInstance(); loadedPlugins.Add(plugin); } /// <summary> /// We do Initialize() in a second loop after CreateInstance /// So that modules who need init before others can do it /// Example: /// Script Engine Componant System needs to load its componants before RegionLoader starts /// </summary> foreach (T plugin in loadedPlugins) { Initialiser.Initialise(plugin); Plugins.Add(plugin); } } }
public void Load() { if (m_log.IsDebugEnabled) { m_log.DebugFormat("{0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); } foreach (string ext in extpoints) { log.Info("[PLUGINS]: Loading extension point " + ext); if (constraints.ContainsKey(ext)) { IPluginConstraint cons = constraints[ext]; if (cons.Apply(ext)) { log.Error("[PLUGINS]: " + ext + " failed constraint: " + cons.Message); } } IPluginFilter filter = null; if (filters.ContainsKey(ext)) { filter = filters[ext]; } List <T> loadedPlugins = new List <T>(); foreach (PluginExtensionNode node in AddinManager.GetExtensionNodes(ext)) { log.Info("[PLUGINS]: Trying plugin " + node.Path); if ((filter != null) && (filter.Apply(node) == false)) { continue; } T plugin = (T)node.CreateInstance(); loadedPlugins.Add(plugin); } // We do Initialise() in a second loop after CreateInstance // So that modules who need init before others can do it // Example: Script Engine Component System needs to load its components before RegionLoader starts foreach (T plugin in loadedPlugins) { Initialiser.Initialise(plugin); Plugins.Add(plugin); } } }
public async Task WhenSpeakerFound_ReturnsSpeaker() { const string NAME_TO_SEARCH = "Scott Guthrie"; var opts = Initialiser.ConferenceApiConfig(); var clientFactoryForSpeakers = Initialiser.ConferenceClientFactory(ConferenceApiResponses.SpeakersResponse); var sut = new ConferenceApiService(opts, clientFactoryForSpeakers); var result = await sut.FindSpeaker(NAME_TO_SEARCH); //, new DateTime(2013,12,04,11,10,00) Assert.IsType <Item>(result); Assert.Equal(NAME_TO_SEARCH, result.data[0].value); }