FailWith() 공개 메소드

public FailWith ( string message ) : void
message string
리턴 void
예제 #1
0
        public void environment_checks_are_logged_in_diagnostic_log()
        {
            var activator = new FakeActivator();

            activator.SucceedWith("good");
            activator.SucceedWith("better");
            activator.FailWith("worst");

            var activator2 = new FakeActivator();
            var activator3 = new FakeActivator();

            PackageRegistry.LoadPackages(x =>
            {
                x.Activator(activator);
                x.Activator(activator2);
                x.Activator(activator3);
            });

            PackageRegistry.Diagnostics.LogsForSubjectType <IEnvironmentRequirement>()
            .Select(x => x.Subject)
            .ShouldHaveTheSameElementsAs(activator.Requirements());
        }
예제 #2
0
        public void activators_do_not_run_if_any_environment_check_fails()
        {
            var activator = new FakeActivator();

            activator.SucceedWith("good");
            activator.SucceedWith("better");
            activator.FailWith("worst");

            var activator2 = new FakeActivator();
            var activator3 = new FakeActivator();

            PackageRegistry.LoadPackages(x =>
            {
                x.Activator(activator);
                x.Activator(activator2);
                x.Activator(activator3);
            });

            activator.WasActivated.ShouldBeFalse();
            activator2.WasActivated.ShouldBeFalse();
            activator3.WasActivated.ShouldBeFalse();
        }
예제 #3
0
        public void activators_do_not_run_if_any_environment_check_fails()
        {
            var activator = new FakeActivator();
            activator.SucceedWith("good");
            activator.SucceedWith("better");
            activator.FailWith("worst");

            var activator2 = new FakeActivator();
            var activator3 = new FakeActivator();

            PackageRegistry.LoadPackages(x =>
            {
                x.Activator(activator);
                x.Activator(activator2);
                x.Activator(activator3);
            });

            activator.WasActivated.ShouldBeFalse();
            activator2.WasActivated.ShouldBeFalse();
            activator3.WasActivated.ShouldBeFalse();
        }
예제 #4
0
        public void environment_checks_are_logged_in_diagnostic_log()
        {
            var activator = new FakeActivator();
            activator.SucceedWith("good");
            activator.SucceedWith("better");
            activator.FailWith("worst");

            var activator2 = new FakeActivator();
            var activator3 = new FakeActivator();

            PackageRegistry.LoadPackages(x =>
            {
                x.Activator(activator);
                x.Activator(activator2);
                x.Activator(activator3);
            });

            PackageRegistry.Diagnostics.LogsForSubjectType<IEnvironmentRequirement>()
                .Select(x => x.Subject)
                .ShouldHaveTheSameElementsAs(activator.Requirements());
        }