public void FindCommonFruit()
        {
            //Arrange
            var fruitFinder = new FruitFinder();
            var fruits      = new List <string> {
                "Apple", "Pear", "Apple", "Orange", "Grape", "Orange", "Apple"
            };

            //Act
            var response = fruitFinder.GetFruit(fruits);

            //Assert
            response.Should().Be("Apple");
        }
Ejemplo n.º 2
0
 public void Test16()
 {
     string[] fruits =
     {
         "Jeruk",
         "Apel",
         "Anggur",
         "Pepaya",
         "Pisang",
         "Kiwi",
         "Markisa",
     };
     Assert.Equal(5, FruitFinder.IndexFinder(fruits, "Kiwi"));
 }
Ejemplo n.º 3
0
        public void tes_index_finder()
        {
            string[] fruits =
            {
                "Jeruk",
                "Apel",
                "Anggur",
                "Pepaya",
                "Pisang",
                "Kiwi",
                "Markisa",
            };

            Assert.Equal(0, FruitFinder.IndexFinder(fruits, "Jeruk"));
            Assert.Equal(3, FruitFinder.IndexFinder(fruits, "Pepaya"));
            Assert.Equal(6, FruitFinder.IndexFinder(fruits, "Markisa"));
        }