Пример #1
0
 public void AssumeSomethingElse()
 {
     Assume.That(false);
 }
Пример #2
0
        public void ProcessPhysics_ShouldMakeEntitiesCollidingAndNotCollidingWithOtherEntities_WhenThereAreManyCirclesAndRectangles()
        {
            // Arrange
            var physicsSystem       = GetPhysicsSystem();
            var physicsSceneBuilder = new PhysicsSceneBuilder();
            var circle1             = physicsSceneBuilder.AddCircleCollider(0, 0, 10);
            var circle2             = physicsSceneBuilder.AddCircleCollider(15, 0, 10);
            var circle3             = physicsSceneBuilder.AddCircleCollider(50, 50, 10);
            var rectangle1          = physicsSceneBuilder.AddRectangleCollider(0, 0, 20, 10);
            var rectangle2          = physicsSceneBuilder.AddRectangleCollider(45, 45, 10, 5);
            var rectangle3          = physicsSceneBuilder.AddRectangleCollider(150, 100, 10, 5);
            var scene = physicsSceneBuilder.Build();

            // Assume
            Assume.That(circle1.GetComponent <CircleColliderComponent>().IsColliding, Is.False);
            Assume.That(circle2.GetComponent <CircleColliderComponent>().IsColliding, Is.False);
            Assume.That(circle3.GetComponent <CircleColliderComponent>().IsColliding, Is.False);
            Assume.That(rectangle1.GetComponent <RectangleColliderComponent>().IsColliding, Is.False);
            Assume.That(rectangle2.GetComponent <RectangleColliderComponent>().IsColliding, Is.False);
            Assume.That(rectangle3.GetComponent <RectangleColliderComponent>().IsColliding, Is.False);

            // Act
            physicsSystem.ProcessPhysics(scene);

            // Assert
            var circleCollider1 = circle1.GetComponent <CircleColliderComponent>();

            Assert.That(circleCollider1.IsColliding, Is.True);
            Assert.That(circleCollider1.CollidingEntities, Has.Count.EqualTo(2));
            Assert.That(circleCollider1.CollidingEntities, Contains.Item(circle2));
            Assert.That(circleCollider1.CollidingEntities, Contains.Item(rectangle1));

            var circleCollider2 = circle2.GetComponent <CircleColliderComponent>();

            Assert.That(circleCollider2.IsColliding, Is.True);
            Assert.That(circleCollider2.CollidingEntities, Has.Count.EqualTo(2));
            Assert.That(circleCollider2.CollidingEntities, Contains.Item(circle1));
            Assert.That(circleCollider2.CollidingEntities, Contains.Item(rectangle1));

            var circleCollider3 = circle3.GetComponent <CircleColliderComponent>();

            Assert.That(circleCollider3.IsColliding, Is.True);
            Assert.That(circleCollider3.CollidingEntities, Has.Count.EqualTo(1));
            Assert.That(circleCollider3.CollidingEntities.Single(), Is.EqualTo(rectangle2));

            var rectangleCollider1 = rectangle1.GetComponent <RectangleColliderComponent>();

            Assert.That(rectangleCollider1.IsColliding, Is.True);
            Assert.That(rectangleCollider1.CollidingEntities, Has.Count.EqualTo(2));
            Assert.That(rectangleCollider1.CollidingEntities, Contains.Item(circle1));
            Assert.That(rectangleCollider1.CollidingEntities, Contains.Item(circle2));

            var rectangleCollider2 = rectangle2.GetComponent <RectangleColliderComponent>();

            Assert.That(rectangleCollider2.IsColliding, Is.True);
            Assert.That(rectangleCollider2.CollidingEntities, Has.Count.EqualTo(1));
            Assert.That(rectangleCollider2.CollidingEntities, Contains.Item(circle3));

            var rectangleCollider3 = rectangle3.GetComponent <RectangleColliderComponent>();

            Assert.That(rectangleCollider3.IsColliding, Is.False);
            Assert.That(rectangleCollider3.CollidingEntities, Has.Count.EqualTo(0));
        }
Пример #3
0
        //--------------------------------------------------------------------------------------------------

        public RibbonAdaptor(Window window)
        {
            _MainWindow    = window;
            _RibbonControl = window.FindFirstDescendant(cf => cf.ByClassName("MainWindowRibbon"));
            Assume.That(_RibbonControl, Is.Not.Null);
        }
Пример #4
0
        public void AssumptionPasses_ReferenceAndConstraint()
        {
            bool value = true;

            Assume.That(ref value, Is.True);
        }
Пример #5
0
 public void AssumptionPasses_DelegateAndConstraint()
 {
     Assume.That(new ActualValueDelegate <int>(ReturnsFour), Is.EqualTo(4));
 }
Пример #6
0
 public void AssumptionPasses_BooleanWithMessage()
 {
     Assume.That(2 + 2 == 4, "Not Equal");
 }
Пример #7
0
 public void AssumptionPasses_ActualAndConstraint()
 {
     Assume.That(2 + 2, Is.EqualTo(4));
 }
Пример #8
0
 public void FailureThrowsInconclusiveException_BooleanWithMessageAndArgs()
 {
     Assume.That(2 + 2 == 5, "got {0}", 5);
 }
Пример #9
0
 public void FailureThrowsInconclusiveException_ActualAndConstraint()
 {
     Assume.That(2 + 2, Is.EqualTo(5));
 }
Пример #10
0
 public void FailureThrowsInconclusiveException_Boolean()
 {
     Assume.That(2 + 2 == 5);
 }
Пример #11
0
 public void FailureThrowsInconclusiveException_BooleanWithMessage()
 {
     Assume.That(2 + 2 == 5, "message");
 }
Пример #12
0
 public void AssumptionPasses_DelegateAndConstraintWithMessageAndArgs()
 {
     Assume.That(new ActualValueDelegate <int>(ReturnsFour), Is.EqualTo(4), "Should be {0}", 4);
 }
Пример #13
0
 public void AssumeTheWorldIsFlat()
 {
     Assume.That(false);
 }
Пример #14
0
 public void NeverAssume()
 {
     Assume.That(false);
 }
Пример #15
0
 public void AssumeThatFailure()
 {
     var exception = Assert.Throws <InconclusiveException>(() =>
                                                           Assume.That(async() => await One(), Is.EqualTo(2)));
 }
Пример #16
0
 public void FailureThrowsInconclusiveException_ActualAndConstraintWithMessage()
 {
     Assume.That(2 + 2, Is.EqualTo(5), "Error");
 }
Пример #17
0
 public void AssumptionPasses_Boolean()
 {
     Assume.That(2 + 2 == 4);
 }
Пример #18
0
 public void FailureThrowsInconclusiveException_ActualAndConstraintWithMessageAndArgs()
 {
     Assume.That(2 + 2, Is.EqualTo(5), "Should be {0}", 5);
 }
Пример #19
0
 public void AssumptionPasses_BooleanWithMessageAndArgs()
 {
     Assume.That(2 + 2 == 4, "Not Equal to {0}", 4);
 }
Пример #20
0
        public void FailureThrowsInconclusiveException_ReferenceAndConstraint()
        {
            bool value = false;

            Assume.That(ref value, Is.True);
        }
Пример #21
0
 public void AssumptionPasses_ActualAndConstraintWithMessageAndArgs()
 {
     Assume.That(2 + 2, Is.EqualTo(4), "Should be {0}", 4);
 }
Пример #22
0
        public void FailureThrowsInconclusiveException_ReferenceAndConstraintWithMessageAndArgs()
        {
            bool value = false;

            Assume.That(ref value, Is.True, "message is {0}", 42);
        }
Пример #23
0
        public void AssumptionPasses_ReferenceAndConstraintWithMessageAndArgs()
        {
            bool value = true;

            Assume.That(ref value, Is.True, "Message", 42);
        }
Пример #24
0
 public void FailureThrowsInconclusiveException_DelegateAndConstraint()
 {
     Assume.That(new ActualValueDelegate <int>(ReturnsFive), Is.EqualTo(4));
 }
Пример #25
0
        //Prepare some reference resource
        private void PrepareData()
        {
            //////////////////////////////////////////////////////////////////////////////////////
            // NEW Client

            clientId = (new ResourceCreator <Client>(PublicApiAdapter.CreateAdapterForDefaultConnection())).Create();
            Assume.That(!string.IsNullOrEmpty(clientId), "Unable to create Candidate");

            // Adding id into the static list for further cleanup
            PublicAPISetUp.ListClientId.Add(clientId);

            //////////////////////////////////////////////////////////////////////////////////////
            // NEW Recruiter

            Recruiter recruiter = new Recruiter()
            {
                Id     = "-1",
                Owner  = "1",
                Client = clientId
            };

            // Create New Resource
            recruiterId = PublicApiAdapter.CreateAdapterForDefaultConnection().WriteSuccess(recruiter, cleanupAction: null);
            Assume.That(!string.IsNullOrEmpty(recruiterId), "Unable to create Recruiter");

            // Adding id into the static list for further cleanup
            PublicAPISetUp.ListRecruiterId.Add(recruiterId);

            //////////////////////////////////////////////////////////////////////////////////////
            // NEW Job

            Job job = new Job()
            {
                Id        = "-1",
                Owner     = "1",
                Client    = clientId,
                Recruiter = recruiterId,
            };

            jobId = PublicApiAdapter.CreateAdapterForDefaultConnection().WriteSuccess(job, cleanupAction: null);
            Assume.That(!string.IsNullOrEmpty(jobId), "Unable to create new resource");

            // Adding id into the static list for further cleanup
            PublicAPISetUp.ListJobId.Add(jobId);

            //////////////////////////////////////////////////////////////////////////////////////
            // NEW Candidate

            Candidate Candidate = new Candidate()
            {
                Id    = "-1",
                Owner = "1",
            };

            // Create New Resource
            candidateId = PublicApiAdapter.CreateAdapterForDefaultConnection().WriteSuccess(Candidate, cleanupAction: null);
            Assume.That(!string.IsNullOrEmpty(candidateId), "Unable to create new resource");

            // Adding id into the static list for further cleanup
            PublicAPISetUp.ListCandidateId.Add(candidateId);

            //////////////////////////////////////////////////////////////////////////////////////
            // NEW Resume

            Resume resume = new Resume()
            {
                Id        = "-1",
                Candidate = candidateId,
                Owner     = "1",
            };

            // Create New Resource
            resumeId = PublicApiAdapter.CreateAdapterForDefaultConnection().WriteSuccess(resume, cleanupAction: null);
            Assume.That(!string.IsNullOrEmpty(resumeId), "Unable to create new resource");

            // Adding id into the static list for further cleanup
            PublicAPISetUp.ListResumeId.Add(resumeId);
        }
Пример #26
0
 public void FailureThrowsInconclusiveException_DelegateAndConstraintWithMessageAndArgs()
 {
     Assume.That(new ActualValueDelegate <int>(ReturnsFive), Is.EqualTo(4), "Should be {0}", 4);
 }
Пример #27
0
        //--------------------------------------------------------------------------------------------------

        public ViewportAdaptor(Window window)
        {
            _ViewportControl = window.FindFirstDescendant(cf => cf.ByClassName("WorkspaceView"));
            Assume.That(_ViewportControl, Is.Not.Null);
        }
Пример #28
0
 public void AssumeThatSuccess()
 {
     Assume.That(async() => await One(), Is.EqualTo(1));
 }
Пример #29
0
 public void TestWithAllBadValues(
     [Values(-12.0, -4.0, -9.0)] double d)
 {
     Assume.That(d > 0);
     Assert.Pass();
 }
Пример #30
0
            public void NegativeEqualityTestWithToleranceAndWithSameOffset(DateTimeOffset value1, DateTimeOffset value2)
            {
                Assume.That((value1 - value2).Duration() > new TimeSpan(0, 1, 0));

                Assert.That(value1, Is.Not.EqualTo(value2).Within(1).Minutes.WithSameOffset);
            }