public void UpdateForce_IfTheParticleHasInfiniteMass_ThenNoForceIsGenerated()
		{
			var mockParticle = new Mock<IParticle>(MockBehavior.Strict);
			mockParticle.Setup(p => p.IsInfiniteMass).Returns(true);
			var forceGenerator = new FakeSpringForceGenerator(Anchor, SpringConstant, Damping);

			forceGenerator.UpdateForce(mockParticle.Object, Duration);

			mockParticle.VerifyAll();
		}
Exemplo n.º 2
0
        public void UpdateForce_IfTheParticleHasInfiniteMass_ThenNoForceIsGenerated()
        {
            var mockParticle = new Mock <IParticle>(MockBehavior.Strict);

            mockParticle.Setup(p => p.IsInfiniteMass).Returns(true);
            var forceGenerator = new FakeSpringForceGenerator(Anchor, SpringConstant, Damping);

            forceGenerator.UpdateForce(mockParticle.Object, Duration);

            mockParticle.VerifyAll();
        }
		public void UpdateForce_IfTheGammaValueIsZero_ThenNoForceIsGenerated()
		{
			var mockParticle = new Mock<IParticle>(MockBehavior.Strict);
			mockParticle.Setup(p => p.IsInfiniteMass).Returns(false);
			mockParticle.Setup(p => p.Position).Returns(Position);

			//The values for the spring constant and damping give a Gamma of zero
			var forceGenerator = new FakeSpringForceGenerator(Anchor, 0.25, 1.0);

			forceGenerator.UpdateForce(mockParticle.Object, Duration);

			mockParticle.VerifyAll();
		}
Exemplo n.º 4
0
        public void UpdateForce_IfTheGammaValueIsZero_ThenNoForceIsGenerated()
        {
            var mockParticle = new Mock <IParticle>(MockBehavior.Strict);

            mockParticle.Setup(p => p.IsInfiniteMass).Returns(false);
            mockParticle.Setup(p => p.Position).Returns(Position);

            //The values for the spring constant and damping give a Gamma of zero
            var forceGenerator = new FakeSpringForceGenerator(Anchor, 0.25, 1.0);

            forceGenerator.UpdateForce(mockParticle.Object, Duration);

            mockParticle.VerifyAll();
        }
		public void UpdateForce_FakedSpringCalculatesAForce()
		{
			var mockParticle = new Mock<IParticle>(MockBehavior.Strict);
			mockParticle.Setup(p => p.IsInfiniteMass).Returns(false);
			mockParticle.Setup(p => p.Position).Returns(Position);
			mockParticle.Setup(p => p.Velocity).Returns(Velocity);
			mockParticle.Setup(p => p.Mass).Returns(0.1);
			mockParticle.Setup(p => p.AddForce(It.IsAny<Vector3>()));

			var forceGenerator = new FakeSpringForceGenerator(Anchor, SpringConstant, Damping);

			forceGenerator.UpdateForce(mockParticle.Object, Duration);

			mockParticle.VerifyAll();
		}
Exemplo n.º 6
0
        public void UpdateForce_FakedSpringCalculatesAForce()
        {
            var mockParticle = new Mock <IParticle>(MockBehavior.Strict);

            mockParticle.Setup(p => p.IsInfiniteMass).Returns(false);
            mockParticle.Setup(p => p.Position).Returns(Position);
            mockParticle.Setup(p => p.Velocity).Returns(Velocity);
            mockParticle.Setup(p => p.Mass).Returns(0.1);
            mockParticle.Setup(p => p.AddForce(It.IsAny <Vector3>()));

            var forceGenerator = new FakeSpringForceGenerator(Anchor, SpringConstant, Damping);

            forceGenerator.UpdateForce(mockParticle.Object, Duration);

            mockParticle.VerifyAll();
        }