using AIStudio.Tools.PowerPoint; namespace AIStudio.Tests.Tools.PowerPoint; /// /// Checks the kinds of slides the user may choose layouts for. /// [TestFixture] public sealed class LayoutPurposeTests { [Test] public void EveryKindOfSlideIsDescribedForTheUserAndTheModel() { using (Assert.EnterMultipleScope()) { foreach (var purpose in Enum.GetValues()) { Assert.That(purpose.Label(), Is.Not.Empty, $"The kind of slide {purpose} has no label."); Assert.That(purpose.Question(), Does.EndWith("?"), $"The kind of slide {purpose} has no question."); Assert.That(purpose.PromptDescription(), Is.Not.Empty.And.Not.EndWith("."), $"The kind of slide {purpose} has no description, or one which ends where the rule for the model goes on."); } } } /// /// Checks that no two kinds of slides read the same, since the user tells them apart by their labels only. /// [Test] public void EveryKindOfSlideHasALabelOfItsOwn() { var labels = Enum.GetValues().Select(purpose => purpose.Label()).ToList(); Assert.That(labels, Is.Unique); } /// /// Checks that the kinds of slides are grouped by area, in the order of the areas. /// /// /// The forms list the kinds of each area together, in the order of the enum. A kind added at the /// end of the enum rather than within its area would break up the areas. /// [Test] public void TheKindsOfSlidesFollowTheOrderOfTheAreas() { var areas = Enum.GetValues().Select(purpose => purpose.Area()).ToList(); using (Assert.EnterMultipleScope()) { Assert.That(areas, Is.Ordered, "The kinds of an area stand together, and the areas follow their own order."); Assert.That(areas.Distinct(), Is.EquivalentTo(Enum.GetValues()), "Every area has kinds of slides."); } } }