public async Task EditPlanetName_Execute_ChangeName(UniverseSources source)
        {
            var name        = "Test";
            var asyncPlanet = new AsyncPlanet(Universe(source).Planets().Create(name));
            var command     = new EditPlanetName(asyncPlanet);

            name = "Test2";

            Assert.IsTrue(command.CanExecute(name));

            await command.ExecuteAsync(name);

            Assert.AreEqual(name, asyncPlanet.Name());
        }
示例#2
0
        public void Rename_InvokeEvent(UniverseSources source)
        {
            var planet  = new AsyncPlanet(Universe(source).Planets().Create(""));
            var invoked = false;

            planet.PlanetRenamed += (sender, args) => invoked = true;

            var name = "Test";

            planet.Rename(name);

            Assert.AreEqual(name, planet.Name());
            Assert.IsTrue(invoked);
        }