public void WithEmptyHub()
        {
            var mr = new ModuleRecord(42, "name", true);

            Assert.AreEqual("42()", mr.ToString());
            Assert.AreEqual("name()", mr.ToStringWithFullNames());
            Assert.AreEqual("42", mr.ToSimpleString());
            Assert.AreEqual("name", mr.ToSimpleStringWithFullNames());
        }
        public void ModuleNameDoesNotRemoveCloneIfItsTheWholeName()
        {
            var mr = new ModuleRecord(null, "(Clone)");

            Assert.IsEmpty(mr.ToString());
            Assert.AreEqual("Clone", mr.ToStringWithFullNames());
            Assert.IsEmpty(mr.ToSimpleString());
            Assert.AreEqual("Clone", mr.ToSimpleStringWithFullNames());
        }
        public void ModuleNameRemovesClone()
        {
            var mr = new ModuleRecord(null, "name(Clone)");

            Assert.IsEmpty(mr.ToString());
            Assert.AreEqual("name", mr.ToStringWithFullNames());
            Assert.IsEmpty(mr.ToSimpleString());
            Assert.AreEqual("name", mr.ToSimpleStringWithFullNames());
        }
        public void ModuleNumberOnly()
        {
            var mr = new ModuleRecord(42);

            Assert.AreEqual("42", mr.ToString());
            Assert.AreEqual("42", mr.ToStringWithFullNames());
            Assert.AreEqual("42", mr.ToSimpleString());
            Assert.AreEqual("42", mr.ToSimpleStringWithFullNames());
        }
        public void DefaultConstructor_givesBlankStrings()
        {
            var mr = new ModuleRecord();

            Assert.IsEmpty(mr.ToString());
            Assert.IsEmpty(mr.ToStringWithFullNames());
            Assert.IsEmpty(mr.ToSimpleString());
            Assert.IsEmpty(mr.ToSimpleStringWithFullNames());
        }
        public void WithFilledHub()
        {
            var mr = new ModuleRecord(42, "name", true);

            mr.AddModule(new ModuleRecord(2, "name2"));
            mr.AddModule(null);
            mr.AddModule(new ModuleRecord(3, "name3", true));

            Assert.AreEqual("42(2,-,3())", mr.ToString());
            Assert.AreEqual("name(name2,-,name3())", mr.ToStringWithFullNames());

            Assert.AreEqual("2,3,42", mr.ToSimpleString());
            Assert.AreEqual("name,name2,name3", mr.ToSimpleStringWithFullNames());
        }
        public void WithFilledHubWithDuplicates()
        {
            var mr = new ModuleRecord(42, "name", true);

            mr.AddModule(new ModuleRecord(2, "name2"));
            mr.AddModule(null);
            mr.AddModule(new ModuleRecord(3, "name3", true));
            mr.AddModule(new ModuleRecord(3, "name3", true));
            mr.AddModule(new ModuleRecord(4, "turret", false));
            mr.AddModule(new ModuleRecord(4, "turret", false));
            mr.AddModule(new ModuleRecord(4, "turret", false));
            mr.AddModule(new ModuleRecord(4, "turret", false));
            mr.AddModule(new ModuleRecord(4, "turret", false));

            Assert.AreEqual("42(2,-,3(),3(),4,4,4,4,4)", mr.ToString());
            Assert.AreEqual("name(name2,-,name3(),name3(),turret,turret,turret,turret,turret)", mr.ToStringWithFullNames());

            Assert.AreEqual("5*4,2*3,2,42", mr.ToSimpleString());
            Assert.AreEqual("5*turret,2*name3,name,name2", mr.ToSimpleStringWithFullNames());
        }