Announcing AvatarScriptLink.NET 1.2.0
· One min read
AvatarScriptLink.NET version 1.2.0 is now available on NuGet.
This release includes the introduction of Builder methods to assist with the creation of the various objects as well as allowing for the error code and error message to be set prior to calling ToReturnOptionObject()
.
This is especially helpful when arranging unit tests.
New Builders
Builder methods have been added to each of the ScriptLink objects.
[TestMethod]
public void TestMethod1WithFluentBuilder()
{
var expected = "value";
FieldObject fieldObject = FieldObject.Builder()
.FieldNumber("123.45").FieldValue(expected)
.Enabled()
.Build();
Assert.AreEqual(expected, fieldObject.FieldValue);
}
Preset ErrorCode and ErrorMesg
TThere may be use cases in which you do not want to wait until the returning of the response to set the ErrorCode and ErrorMesg.
With this release you can set these values prior to calling ToReturnOptionObject()
.
if (condition)
{
optionObject.ErrorCode = ErrorCode.Alert;
optionObject.ErrorMesg = "An alert message!";
}
return optionObject.ToReturnOptionObject();