public void ValidateAllMethods()
        {
            Hierarchy hierarchy = HierarchyHelper.CreateDefaultHierarchy();

            ValidationMessages messages = new ValidationMessages();
            hierarchy.Enterprise.Site.Add(new Site { name = "Site X" });
            hierarchy.Enterprise.Site.Add(new Site { name = "Site X" });

            ValidateCommand command = new ValidateCommand(hierarchy, messages);
            command.Execute();
            Assert.That(messages, Is.Not.Empty);
            Assert.That(messages.Count, Is.EqualTo(1));
            Assert.That(messages[0].Message, Is.StringContaining("Site X"));
        }
Beispiel #2
0
        public void ValidateAllMethods()
        {
            Hierarchy hierarchy = HierarchyHelper.CreateDefaultHierarchy();

            ValidationMessages messages = new ValidationMessages();

            hierarchy.Enterprise.Site.Add(new Site {
                name = "Site X"
            });
            hierarchy.Enterprise.Site.Add(new Site {
                name = "Site X"
            });

            ValidateCommand command = new ValidateCommand(hierarchy, messages);

            command.Execute();
            Assert.That(messages, Is.Not.Empty);
            Assert.That(messages.Count, Is.EqualTo(1));
            Assert.That(messages[0].Message, Is.StringContaining("Site X"));
        }