public void CreatesValidId() { WithDiscovery(() => { var context = new MspecContextTestElement(new ClrTypeName("Namespace.Context"), null, null); var specification = new MspecSpecificationTestElement(context, "should", null, null, null); Assert.AreEqual("Namespace.Context.should", specification.NaturalId.TestId); }); }
public void UnreportedParentsAreAddedToSet() { WithDiscovery(() => { var context = new MspecContextTestElement(new ClrTypeName("Namespace.Context"), null, null); var behavior = new MspecSpecificationTestElement(context, "behaves_like", "Namespace.ABehavior", null, null); var specification = new MspecBehaviorSpecificationTestElement(behavior, "should", null); var elements = new HashSet <IUnitTestElement> { context, specification }; var rule = new EnsureAncestorsAddedToExecutedElementsRule(); rule.Apply(elements, null !, null !); CollectionAssert.Contains(elements, behavior); }); }