public void SurfaceCollection_TestWillNotAddNullSurface_ReturnsFalse() { var messenger = Substitute.For <IFrameworkMessenger>(); var collection = new GpuSurfaceCollection(messenger); Assert.False(collection.Add(0, null)); }
public void SurfaceCollection_TestWillNotAddSurfaceAtExistingId_ReturnsFalse() { var messenger = Substitute.For <IFrameworkMessenger>(); var collection = new GpuSurfaceCollection(messenger); collection.Add(50, new GpuSurface()); Assert.False(collection.Add(50, new GpuSurface())); }
public void SurfaceCollection_TestMultiFlagCountType_Returns1CountOfInternalTexture() { var messenger = Substitute.For <IFrameworkMessenger>(); var collection = new GpuSurfaceCollection(messenger); AddToCollectionTwoInternalTwoRenderTargetsAndOneTexture(collection); Assert.Equal(1, collection.CountOfType(GpuSurfaceType.Internal | GpuSurfaceType.Texture)); }
public void SurfaceCollection_TestCountAll_Returns5() { var messenger = Substitute.For <IFrameworkMessenger>(); var collection = new GpuSurfaceCollection(messenger); AddToCollectionTwoInternalTwoRenderTargetsAndOneTexture(collection); Assert.Equal(5, collection.CountAll()); }
public void SurfaceCollection_TestRemoveAtIdFailsIfIdNotPresent_ReturnsFalse() { var messenger = Substitute.For <IFrameworkMessenger>(); var collection = new GpuSurfaceCollection(messenger); AddToCollectionTwoInternalTwoRenderTargetsAndOneTexture(collection); Assert.False(collection.Remove(7)); }
public void SurfaceCollection_TestRetrieveAtId_ReturnsSurfaceWithUndefinedType() { var messenger = Substitute.For <IFrameworkMessenger>(); var collection = new GpuSurfaceCollection(messenger); AddToCollectionTwoInternalTwoRenderTargetsAndOneTexture(collection); var surface = collection.Retrieve(1); Assert.Equal(GpuSurfaceType.Undefined, surface.Type); }
public void SurfaceCollection_TestRemoveTypeTexture_Returns3() { var messenger = Substitute.For <IFrameworkMessenger>(); var collection = new GpuSurfaceCollection(messenger); AddToCollectionTwoInternalTwoRenderTargetsAndOneTexture(collection); var ids = collection.ReturnAllOfType(GpuSurfaceType.Texture); ids.ForEach(id => { collection.Remove(id); }); Assert.Equal(3, collection.CountAll()); }