public void StringToBStr_NullStringWorks() { //Act using (var target = SafeBStrHandle.StringToBStr(null)) { //Assert target.Pointer.Should().BeZero(); target.IsInvalid.Should().BeTrue(); }; }
public void ToString_ReturnsString() { var expected = "Hello"; var target = SafeBStrHandle.StringToBStr(expected); //Act var actual = target.ToString(); //Assert actual.Should().Be(expected); }
public void StringToBStr_ValidStringWorks() { var str = "Hello"; //Act using (var target = SafeBStrHandle.StringToBStr(str)) { //Assert target.Pointer.Should().NotBeZero(); target.IsInvalid.Should().BeFalse(); AssertMemory(target.Pointer, Encoding.Unicode.GetBytes("Hello")); }; }