Beispiel #1
0
        public void GivenCustomerRequirement_WhenDeriving_ThenDescriptionIsRequired()
        {
            var builder = new CustomerRequirementBuilder(this.DatabaseSession);
            var customerRequirement = builder.Build();

            Assert.IsTrue(this.DatabaseSession.Derive().HasErrors);

            this.DatabaseSession.Rollback();

            builder.WithDescription("CustomerRequirement");
            builder.Build();

            Assert.IsFalse(this.DatabaseSession.Derive().HasErrors);
        }
        public void GivenCustomerRequirement_WhenDeriving_ThenRequiredRelationsMustExist()
        {
            var builder = new CustomerRequirementBuilder(this.DatabaseSession);
            var requirement = builder.Build();

            Assert.IsTrue(this.DatabaseSession.Derive().HasErrors);

            this.DatabaseSession.Rollback();

            builder.WithDescription("requirement");
            requirement = builder.Build();

            Assert.IsFalse(this.DatabaseSession.Derive().HasErrors);

            Assert.AreEqual(requirement.CurrentRequirementStatus.RequirementObjectState, new RequirementObjectStates(this.DatabaseSession).Active);
            Assert.AreEqual(requirement.CurrentObjectState, new RequirementObjectStates(this.DatabaseSession).Active);
            Assert.AreEqual(requirement.CurrentObjectState, requirement.LastObjectState);
        }