예제 #1
0
 public void Mushrooms_InvalidData()
 {
     int N = 10;
     int X = 11;
     Mushrooms mushrooms = new Mushrooms();
     int white_mushrooms = 0;
     int expected_whitemushrooms = -1;
     white_mushrooms = mushrooms.CalculateWhiteMushrroms(N, X);
     Assert.AreEqual(expected_whitemushrooms, white_mushrooms);
 }
 public void Mushrooms_Solution()
 {
     int N = 10;
     int X = 4;
     Mushrooms mushrooms = new Mushrooms();
     int white_mushrooms = 0;
     int red_mushrooms = 0;
     int expected_whitemushrooms = 2;
     int expected_redmushrooms = 8;
     white_mushrooms = mushrooms.CalculateWhiteMushrroms(N, X);
     red_mushrooms = X * white_mushrooms;
     Assert.AreEqual(expected_whitemushrooms, white_mushrooms);
     Assert.AreEqual(expected_redmushrooms, red_mushrooms);
 }
 public void Mushrooms_XNoDividedN()
 {
     int N = 10;
     int X = 3;
     Mushrooms mushrooms = new Mushrooms();
     int white_mushrooms = 0;
     int red_mushrooms = 0;
     int expected_whitemushrooms = 0;
     int expected_redmushrooms = 0;
     white_mushrooms = mushrooms.CalculateWhiteMushrroms(N, X);
     red_mushrooms = X * white_mushrooms;
     Assert.AreEqual(expected_whitemushrooms, white_mushrooms);
     Assert.AreEqual(expected_redmushrooms, red_mushrooms);
 }