public void GetButtonConditionPasses() { var styleInfo = new InputViewerStyleInfo(); styleInfo.ButtonColorAtFree = Color.red; styleInfo.ButtonColorAtDown = Color.blue; styleInfo.ButtonColorAtPush = Color.green; styleInfo.ButtonColorAtUp = Color.yellow; Assert.AreEqual(styleInfo.ButtonColorAtFree, styleInfo.GetButtonCondition(InputDefines.ButtonCondition.Free)); Assert.AreEqual(styleInfo.ButtonColorAtDown, styleInfo.GetButtonCondition(InputDefines.ButtonCondition.Down)); Assert.AreEqual(styleInfo.ButtonColorAtPush, styleInfo.GetButtonCondition(InputDefines.ButtonCondition.Push)); Assert.AreEqual(styleInfo.ButtonColorAtUp, styleInfo.GetButtonCondition(InputDefines.ButtonCondition.Up)); }
public void OnChangedDelegateByFontColorPasses() { var styleInfo = new InputViewerStyleInfo(); Color recievedFontColor = default(Color); styleInfo.OnChanged.Add(info => { Assert.AreSame(styleInfo, info); recievedFontColor = info.FontColor; }); var font = new Font(); styleInfo.FontColor = Color.green; Assert.AreEqual(styleInfo.FontColor, recievedFontColor); }
public void OnChangedDelegateByFontPasses() { var styleInfo = new InputViewerStyleInfo(); Font recievedFont = null; styleInfo.OnChanged.Add(info => { Assert.AreSame(styleInfo, info); recievedFont = info.Font; }); var font = new Font(); styleInfo.Font = new Font(); Assert.AreSame(styleInfo.Font, recievedFont); }
public void OnChangedDelegateByButtonColorPasses() { var styleInfo = new InputViewerStyleInfo(); Color[] recievedColors = Enumerable.Range(0, 4).Select(_ => default(Color)).ToArray(); int recievedCount = 0; styleInfo.OnChanged.Add(info => { Assert.AreSame(styleInfo, info); recievedCount++; recievedColors[0] = info.ButtonColorAtFree; recievedColors[1] = info.ButtonColorAtDown; recievedColors[2] = info.ButtonColorAtPush; recievedColors[3] = info.ButtonColorAtUp; }); { styleInfo.ButtonColorAtFree = Color.red; Assert.AreEqual(styleInfo.ButtonColorAtFree, recievedColors[0]); } Debug.Log($"Success to Change ButtonColorAtFree!"); { styleInfo.ButtonColorAtDown = Color.blue; Assert.AreEqual(styleInfo.ButtonColorAtDown, recievedColors[1]); } Debug.Log($"Success to Change ButtonColorAtDown!"); { styleInfo.ButtonColorAtPush = Color.green; Assert.AreEqual(styleInfo.ButtonColorAtPush, recievedColors[2]); } Debug.Log($"Success to Change ButtonColorAtPush!"); { styleInfo.ButtonColorAtUp = Color.yellow; Assert.AreEqual(styleInfo.ButtonColorAtUp, recievedColors[3]); } Debug.Log($"Success to Change ButtonColorAtUp!"); Assert.AreEqual(4, recievedCount); Debug.Log($"Success to Call Count Of OnChangedStyleInfo!"); }
public override void OnChangedStyle(InputViewerStyleInfo styleInfo) { }
public override void OnChangedStyle(InputViewerStyleInfo styleInfo) { OnChangedStyleCallCounter++; }