public void ReturnsError() { const string errorStr = "error"; string error = null; var remoteValue = Substitute.For <RemoteValue>(); remoteValue.GetPointeeAsByteString(1, Arg.Any <uint>(), out error) .Returns(x => { x[2] = errorStr; return(null); }); IRemoteValueFormat format = RemoteValueFormatProvider.Get("s"); Assert.AreEqual(errorStr, format.FormatValue(remoteValue, _fallback)); Assert.IsNull(format.FormatStringView(remoteValue, _fallback)); }