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); }; }
public void Allocate_InvalidSizeFails() { Action action = () => SafeComMemoryHandle.Allocate(-5); action.ShouldThrowArgumentOutOfRangeException(); }