예제 #1
0
        public Topic(ITopicNode parent, ITopicFile file) : base(Path.GetFileNameWithoutExtension(file.FilePath))
        {
            if (parent == null)
            {
                throw new ArgumentNullException("parent");
            }

            Project = parent.Project;

            File = file;

            IsIndex = Name.EqualsIgnoreCase(Index);
            if (IsIndex)
            {
                Key         = parent.Url;
                OrderString = file.RelativeFile.IsEmpty() ? string.Empty : file.RelativeFile.ParentUrl();
            }
            else
            {
                Key = parent.Url.AppendUrl(Name);
            }

            OrderString = OrderString.Replace(".spark", "");

            TopicBuilder.BuildOut(this);
        }
        public void spot_check_a_topic()
        {
            ITopicFile file = ObjectMother.Files.First(x => x.Name == "1.3.purple");

            file.ShouldNotBeNull();

            file.Folder.ShouldEqual("colors");
        }