public void should_get_count() { //arrange var request = new Request(); //act var res = request.GetRequestCount(); //assert Assert.LessOrEqual(0,res); }
public void should_send_package_with_data() { //arrange var request = new Request(); string userName = Guid.NewGuid().ToString(); string userPassword = Guid.NewGuid().ToString(); //act request.Send(userName + userPassword); //assert Assert.Pass(); }
public void should_request_get_request_count() { //arrange Random rand = new Random(); int expected = rand.Next(10); var request = new Request(expected); //act var res = request.GetRequestCount(); //assert Assert.AreEqual(res, expected); }
public void should_request_send_with_any_string_packet() { using (StringWriter sw = new StringWriter()) { //arrange Console.SetOut(sw); var request = new Request(new Random().Next(10)); int beforeCount = request.GetRequestCount(); string packet = Guid.NewGuid().ToString(); string expected = string.Format("Packet data: {0}{1}", packet, Environment.NewLine); //act request.Send(packet); int afterCount = request.GetRequestCount(); //assert Assert.AreEqual(afterCount - beforeCount, 1); Assert.AreEqual(expected, sw.ToString()); //after test ConsoleInitialize(); } }