示例#1
0
 public void Setup()
 {
     _planet = new Planet(Guid.NewGuid(), "Earth");
     _station = new Station(Guid.NewGuid(), new Vector3(10, 0, 20));
     _ship = new Ship(Guid.NewGuid(), new Pose(new Vector3(5, 6, 7), Vector3.UnitX, Vector3.UnitY));
     _inventory = new Inventory(Guid.NewGuid());
 }
示例#2
0
 public void ItemsMatchedByID()
 {
     var planetClone = new Planet(_planet.ID, _planet.Name);
     var world = World.Empty.SetWob(_planet);
     var world2 = World.Empty.SetWob(planetClone);
     Assert.True(new WorldDiff(world, world2).IsEmpty);
 }
示例#3
0
 public void Modified_Wobs()
 {
     var planet2 = new Planet(_planet.ID, "Jupiter");
     var ship2 = new Ship(_ship.ID, _ship.Pose.Move(new Vector3(50, 0, 0), 0, 0, 0));
     AssertDiffAndPatch(
         World.Empty.SetWob(_planet).SetWob(_ship),
         World.Empty.SetWob(planet2).SetWob(ship2),
         d =>
         {
             CollectionAssert.AreEquivalent(new Wob[] { _planet, _ship }, d.Wobs.Removed.Values);
             CollectionAssert.AreEquivalent(new Wob[] { planet2, ship2 }, d.Wobs.Added.Values);
         });
 }