public void TestConstructFromResource() { using ( FlatGuiVisualizer visualizer = FlatGuiVisualizer.FromResource( this.mockedGraphicsDeviceService.ServiceProvider, Resources.UnitTestResources.ResourceManager, "UnitTestSkin" ) ) { Assert.IsNotNull(visualizer); // nonsense to avoid compiler warning } }
public void TestAccessControlRepository() { using ( FlatGuiVisualizer visualizer = FlatGuiVisualizer.FromResource( this.mockedGraphicsDeviceService.ServiceProvider, Resources.UnitTestResources.ResourceManager, "UnitTestSkin" ) ) { // The visualizer should have added its own assembly to the list automatically Assert.AreEqual(1, visualizer.RendererRepository.LoadedAssemblies.Count); } }
public void TestThrowOnConstructFromBrokenResource() { Assert.Throws <ArgumentException>( delegate() { using ( FlatGuiVisualizer visualizer = FlatGuiVisualizer.FromResource( this.mockedGraphicsDeviceService.ServiceProvider, Resources.UnitTestResources.ResourceManager, "BadColorSkin" ) ) { } } ); }
public void TestConstructFromFile() { using (ResourceFileKeeper keeper = new ResourceFileKeeper()) { using ( FlatGuiVisualizer visualizer = FlatGuiVisualizer.FromFile( this.mockedGraphicsDeviceService.ServiceProvider, Path.Combine(keeper.ResourcePath, "UnitTest.skin.xml") ) ) { Assert.IsNotNull(visualizer); // nonsense to avoid compiler warning } } }
public void TestDrawNonRenderableControl() { using ( FlatGuiVisualizer visualizer = FlatGuiVisualizer.FromResource( this.mockedGraphicsDeviceService.ServiceProvider, Resources.UnitTestResources.ResourceManager, "UnitTestSkin" ) ) { Screen screen = new Screen(800, 600); screen.Desktop.Children.Add(new NonRenderableControl()); visualizer.Draw(screen); } }
public void TestThrowOnConstructFromBrokenFile() { using (ResourceFileKeeper keeper = new ResourceFileKeeper()) { Assert.Throws <ArgumentException>( delegate() { using ( FlatGuiVisualizer visualizer = FlatGuiVisualizer.FromFile( this.mockedGraphicsDeviceService.ServiceProvider, Path.Combine(keeper.ResourcePath, "BadColor.skin.xml") ) ) { } } ); } }