Beispiel #1
0
        public void cubes_that_do_not_touch()
        {
            var cubeA = new CubeService().CenteredAt(2, 2, 2).WithEdgeLength(2).Build();
            var cubeB = new CubeService().CenteredAt(10, 10, 10).WithEdgeLength(2).Build();

            Assert.IsFalse(cubeA.CollidesWith(cubeB));
        }
Beispiel #2
0
        public void cubes_that_overlap()
        {
            var cubeA = new CubeService().CenteredAt(2, 2, 2).WithEdgeLength(2).Build();
            var cubeB = new CubeService().CenteredAt(3, 2, 2).WithEdgeLength(2).Build();

            Assert.IsTrue(cubeA.CollidesWith(cubeB));
        }
Beispiel #3
0
        public void CubeService_ThatDoNotCollides_ShouldReturnFalse()
        {
            // Arrange
            var cubeService = new CubeService(new BorderService());
            var cubeA       = new Cube(new Position(2, 2, 2), 2);
            var cubeB       = new Cube(new Position(10, 10, 10), 2);

            // Act
            var result = cubeService.CollidesWith(cubeA, cubeB);

            // Assert
            Assert.False(result);
        }
Beispiel #4
0
        public void CubeService_ThatOverlap_ShouldReturnTrue()
        {
            // Arrange
            var cubeService = new CubeService(new BorderService());
            var cubeA       = new Cube(new Position(2, 2, 2), 2);
            var cubeB       = new Cube(new Position(3, 2, 2), 2);

            // Act
            var result = cubeService.CollidesWith(cubeA, cubeB);

            // Assert
            Assert.True(result);
        }