Exemplo n.º 1
0
        public void Allocate_ValidSizeWorks()
        {
            //Act
            using (var target = SafeComMemoryHandle.Allocate(256))
            {
                var actual = target.Pointer;

                var written = WriteMemory(target.Pointer, 256);

                //Assert
                target.IsInvalid.Should().BeFalse();
                AssertMemory(target.Pointer, written);
            };
        }
Exemplo n.º 2
0
        public void Allocate_InvalidSizeFails()
        {
            Action action = () => SafeComMemoryHandle.Allocate(-5);

            action.ShouldThrowArgumentOutOfRangeException();
        }