コード例 #1
0
        public void CalculateAutonomy_Should_Return_Unknown()
        {
            // Arrange
            Starship starship = new Starship();

            // Act
            var autonomy = starship.CalculateAutonomy(1000000, -1);

            // Assert
            Assert.Equal("unknown", autonomy);
        }
コード例 #2
0
        public void CalculateAutonomy_Should_Return_9_MGLT()
        {
            // Arrange
            Starship starship = new Starship();

            starship.Consumables = "2 months";
            starship.MGLT        = "75";

            // Act
            var consumable = starship.TransformConsumableToHours();
            var autonomy   = starship.CalculateAutonomy(1000000, consumable);

            // Assert
            Assert.Equal("9", autonomy);
        }