public void TestSavingVisibility2() { var root = new Body { Location = new Frame3D(10, 0, 0) }; Body box = new Box { Location = new Frame3D(10, 20, 30) }; var lo = new LoggingObject(box, root); for (int i = 0; i < 100; i++) { lo.SaveVisibilityState(i); Assert.AreEqual(false, lo.VisibilityStates.Last().IsVisible); Assert.AreEqual(0, lo.VisibilityStates.Last().StartTime); } //body suddenly appears. const int updateTime = 100; root.Add(box); lo.SaveVisibilityState(updateTime); Assert.AreEqual(2, lo.VisibilityStates.Count); Assert.AreEqual(true, lo.VisibilityStates.Last().IsVisible); Assert.AreEqual(updateTime, lo.VisibilityStates.Last().StartTime); }
public void TestSaveVisibility() { var root = new Body { Location = new Frame3D(10, 0, 0) }; Body box = new Box { Location = new Frame3D(10, 20, 30) }; root.Add(box); var lo = new LoggingObject(box, root); lo.SaveVisibilityState(_totalTime); Assert.AreEqual(1, lo.VisibilityStates.Count); Assert.AreEqual(_totalTime, lo.VisibilityStates[0].StartTime); _totalTime++; lo.SaveVisibilityState(_totalTime); Assert.AreEqual(1, lo.VisibilityStates.Count); Assert.AreEqual(true, lo.VisibilityStates[0].IsVisible); root.Remove(box); _totalTime++; lo.SaveVisibilityState(_totalTime); Assert.AreEqual(_totalTime, lo.VisibilityStates.Last().StartTime); Assert.AreEqual(2, lo.VisibilityStates.Count); Assert.AreEqual(false, lo.VisibilityStates.Last().IsVisible); }
public void TestSaveVisibility() { var root = new Body { Location = new Frame3D(10, 0, 0) }; Body box = new Box { Location = new Frame3D(10, 20, 30) }; root.Add(box); var lo = new LoggingObject(box, root); lo.SaveVisibilityState(_totalTime); Assert.AreEqual(1, lo.VisibilityStates.Count); Assert.AreEqual(_totalTime, lo.VisibilityStates[0].StartTime); _totalTime ++; lo.SaveVisibilityState(_totalTime); Assert.AreEqual(1, lo.VisibilityStates.Count); Assert.AreEqual(true, lo.VisibilityStates[0].IsVisible); root.Remove(box); _totalTime++; lo.SaveVisibilityState(_totalTime); Assert.AreEqual(_totalTime, lo.VisibilityStates.Last().StartTime); Assert.AreEqual(2, lo.VisibilityStates.Count); Assert.AreEqual(false, lo.VisibilityStates.Last().IsVisible); }