public void SubFontTools_ExtractNamedFloatFromLine_ReturnNullFromNullInput() { var messenger = Substitute.For <IFrameworkMessenger>(); ISubFontTools tools = new SubFontTools(messenger); var result = tools.ExtractNamedFloatFromLine(null, "test"); Assert.Null(result); result = tools.ExtractNamedFloatFromLine("test", null); Assert.Null(result); result = tools.ExtractNamedFloatFromLine(null, null); Assert.Null(result); }
public void SubFontTools_ExtractNamedFloatFromLine_ReturnCorrectValue() { var messenger = Substitute.For <IFrameworkMessenger>(); ISubFontTools tools = new SubFontTools(messenger); var name = "happiness"; var line = "what s @ ?? .. 98TH happ i n ess ..kk /* happiness=205.3 _ whatever "; var result = tools.ExtractNamedFloatFromLine(name, line); Assert.Equal(205.3f, (float)result); }