Ejemplo n.º 1
0
        public void DeactivateMemoryBuffer_SetsActive_ForBlock_False()
        {
            // arrange
            uint bufferId;

            _manager.AllocateMemoryBuffer(100, out bufferId);
            Assert.AreEqual(1, _manager.GetBlocks.Count);
            Assert.IsTrue(_manager.GetBlocks.First().Active);

            // act
            _manager.DeactivateMemoryBuffer(bufferId);

            // assert
            Assert.IsFalse(_manager.GetBlocks.First().Active);
        }
Ejemplo n.º 2
0
        public void AllocateMemoryBuffer_WhenManagerNotInitialised_Ignored_OK()
        {
            using (var manager = new MemoryManager())
            {
                // not initialised

                // arrange

                // act & assert
                Assert.That(() => manager.AllocateMemoryBuffer(100, out _), Throws.Nothing);
            }
        }