using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
public static void Main()
new UnitTests().TestSquareOneByOne();
new UnitTests().TestSquareFiveByFive();
new UnitTests().TestRectangleFiveByThree();
new UnitTests().TestRectangleFiveByOne();
new UnitTests().TestRectangleFivtyByTwenty();
new UnitTests().TestRectangleTwentyByFivty();
new UnitTests().TestRectangleHundredByNinetyNine();
private List<int> GenerateExpectedListForTestHundredByNinetyNine()
List<int> result = new List<int>();
for (int i = 0; i < 99; ++i)
public void TestSquareOneByOne()
List<int> expectedList = new List<int>();
List<int> resultList = RectangleIntoSquares.Convert(1, 1);
Assert.AreEqual(expectedList, resultList);
public void TestSquareFiveByFive()
List<int> expectedList = new List<int>();
List<int> resultList = RectangleIntoSquares.Convert(5, 5);
Assert.AreEqual(expectedList, resultList);
public void TestRectangleFiveByThree()
List<int> expectedList = new List<int> { 3, 2, 1, 1 };
List<int> resultList = RectangleIntoSquares.Convert(5, 3);
Assert.AreEqual(expectedList, resultList);
public void TestRectangleFiveByOne()
List<int> expectedList = new List<int> { 1, 1, 1, 1, 1 };
List<int> resultList = RectangleIntoSquares.Convert(5, 1);
Assert.AreEqual(expectedList, resultList);
public void TestRectangleFivtyByTwenty()
List<int> expectedList = new List<int> { 20, 20, 10, 10 };
List<int> resultList = RectangleIntoSquares.Convert(50, 20);
Assert.AreEqual(expectedList, resultList);
public void TestRectangleTwentyByFivty()
List<int> expectedList = new List<int> { 20, 20, 10, 10 };
List<int> resultList = RectangleIntoSquares.Convert(20, 50);
Assert.AreEqual(expectedList, resultList);
public void TestRectangleHundredByNinetyNine()
List<int> expectedList = GenerateExpectedListForTestHundredByNinetyNine();
List<int> resultList = RectangleIntoSquares.Convert(100, 99);
Assert.AreEqual(expectedList, resultList);
public static class RectangleIntoSquares
public static List<int> Convert(int width, int height)