public void TabContentRemoveView() { tlog.Debug(tag, $"TabContentRemoveView START"); var testingTarget = new MyTabContent() { Size = new Size(100, 100), }; Assert.IsNotNull(testingTarget, "null handle"); Assert.IsInstanceOf <TabContent>(testingTarget, "Should return TabContent instance."); View dummy1 = new View() { Size = new Size(50, 100), Position = new Position(0, 0), }; View dummy2 = new View() { Size = new Size(50, 100), Position = new Position(50, 0), }; testingTarget.OnAddView(dummy1); testingTarget.OnAddView(dummy2); testingTarget.OnSelect(0); try { testingTarget.OnRemoveView(dummy1); } catch (Exception e) { tlog.Debug(tag, e.Message.ToString()); Assert.Fail("Caught Exception : Failed!"); } dummy1.Dispose(); dummy2.Dispose(); testingTarget.OnDispose(DisposeTypes.Explicit); tlog.Debug(tag, $"TabContentRemoveView END (OK)"); }
public void TabContentDispose() { tlog.Debug(tag, $"TabContentDispose START"); var testingTarget = new MyTabContent(); Assert.IsNotNull(testingTarget, "null handle"); Assert.IsInstanceOf <TabContent>(testingTarget, "Should return TabContent instance."); try { testingTarget.OnDispose(DisposeTypes.Explicit); } catch (Exception e) { tlog.Debug(tag, e.Message.ToString()); Assert.Fail("Caught Exception : Failed!"); } testingTarget.Dispose(); tlog.Debug(tag, $"TabContentDispose END (OK)"); }
public void TabContentRemoveViewWithNull() { tlog.Debug(tag, $"TabContentRemoveViewWithNull START"); var testingTarget = new MyTabContent(); Assert.IsNotNull(testingTarget, "null handle"); Assert.IsInstanceOf <TabContent>(testingTarget, "Should return TabContent instance."); View view = null; try { testingTarget.OnRemoveView(view); } catch (ArgumentNullException) { testingTarget.Dispose(); tlog.Debug(tag, $"TabContentRemoveViewWithNull END (OK)"); Assert.Pass("Caught ArgumentNullException : Passed!"); } }