public void UpdateForce_IfTheObjectIsOutOfTheLiquid_NoBuoyancyForceIsGenerated()
		{
			var mockParticle = new Mock<IParticle>(MockBehavior.Strict);
			mockParticle.Setup(p => p.Position).Returns(new Vector3(0.0, 14.0, 0.0));
			var forceGenerator = new BuoyancySpringForceGenerator(MaxDepth, Volume, LiquidHeight);

			forceGenerator.UpdateForce(mockParticle.Object, Duration);

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

            mockParticle.Setup(p => p.Position).Returns(new Vector3(0.0, 14.0, 0.0));
            var forceGenerator = new BuoyancySpringForceGenerator(MaxDepth, Volume, LiquidHeight);

            forceGenerator.UpdateForce(mockParticle.Object, Duration);

            mockParticle.VerifyAll();
        }
		public void UpdateForce_IfTheObjectIsHalfSubmerged_TheBuoyancyForceIsHalfOfWhenFullySubmerged()
		{
			var mockParticle = new Mock<IParticle>(MockBehavior.Strict);
			mockParticle.Setup(p => p.Position).Returns(new Vector3(0.0, 8.0, 0.0));
			mockParticle.Setup(p => p.AddForce(FullBuoyancy /2.0));
			var forceGenerator = new BuoyancySpringForceGenerator(MaxDepth, Volume, LiquidHeight);

			forceGenerator.UpdateForce(mockParticle.Object, Duration);

			mockParticle.VerifyAll();
		}
		public void UpdateForce_TheBuoyancyForceGenerated_DependsOnTheDensityOfTheLiquid()
		{
			var mockParticle = new Mock<IParticle>(MockBehavior.Strict);
			mockParticle.Setup(p => p.Position).Returns(new Vector3(0.0, 6.0, 0.0));
			mockParticle.Setup(p => p.AddForce(FullBuoyancy / 10.0));
			var forceGenerator = new BuoyancySpringForceGenerator(MaxDepth, Volume, LiquidHeight, 100.0);

			forceGenerator.UpdateForce(mockParticle.Object, Duration);

			mockParticle.VerifyAll();
		}
Esempio n. 5
0
        public void UpdateForce_IfTheObjectIsHalfSubmerged_TheBuoyancyForceIsHalfOfWhenFullySubmerged()
        {
            var mockParticle = new Mock <IParticle>(MockBehavior.Strict);

            mockParticle.Setup(p => p.Position).Returns(new Vector3(0.0, 8.0, 0.0));
            mockParticle.Setup(p => p.AddForce(FullBuoyancy / 2.0));
            var forceGenerator = new BuoyancySpringForceGenerator(MaxDepth, Volume, LiquidHeight);

            forceGenerator.UpdateForce(mockParticle.Object, Duration);

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

            mockParticle.Setup(p => p.Position).Returns(new Vector3(0.0, 6.0, 0.0));
            mockParticle.Setup(p => p.AddForce(FullBuoyancy / 10.0));
            var forceGenerator = new BuoyancySpringForceGenerator(MaxDepth, Volume, LiquidHeight, 100.0);

            forceGenerator.UpdateForce(mockParticle.Object, Duration);

            mockParticle.VerifyAll();
        }