コード例 #1
0
        public void GivenNeededSkill_WhenDeriving_ThenRequiredRelationsMustExist()
        {
            var projectManagement = new Skills(this.Session).ProjectManagement;
            var expert            = new SkillLevels(this.Session).Expert;

            var builder     = new NeededSkillBuilder(this.Session);
            var neededSkill = builder.Build();

            Assert.True(this.Session.Derive(false).HasErrors);

            this.Session.Rollback();

            builder.WithSkill(projectManagement);
            neededSkill = builder.Build();

            Assert.True(this.Session.Derive(false).HasErrors);

            this.Session.Rollback();

            builder.WithSkillLevel(expert);
            neededSkill = builder.Build();

            Assert.False(this.Session.Derive(false).HasErrors);
        }
コード例 #2
0
ファイル: NeededSkillTests.cs プロジェクト: Allors/apps
        public void GivenNeededSkill_WhenDeriving_ThenRequiredRelationsMustExist()
        {
            var projectManagement = new Skills(this.DatabaseSession).ProjectManagement;
            var expert = new SkillLevels(this.DatabaseSession).Expert;

            var builder = new NeededSkillBuilder(this.DatabaseSession);
            var neededSkill = builder.Build();

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

            this.DatabaseSession.Rollback();

            builder.WithSkill(projectManagement);
            neededSkill = builder.Build();

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

            this.DatabaseSession.Rollback();

            builder.WithSkillLevel(expert);
            neededSkill = builder.Build();

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