public void GenerateNewUserTest() { /** Testing is a process that can be divided to 3 parts * * First part is Arrange * Second is Act * Third Assert * **/ // Arrange // this is a mock used to test whether the method call the web service IUserControllerClientProxy proxyMock = Substitute.For<IUserControllerClientProxy>(); Login user = new Login(); user.Username = "******"; user.Password = "******"; //Act LoginController controller = new LoginController(proxyMock, user); controller.CreateNewUser(); //Assert proxyMock.Received().GenerateNewUser(user.Username, user.Password); }
public LoginController(IUserControllerClientProxy clientProxy, Login user) { _UserClientServiceProxy = clientProxy; _user = user; }
public LoginController() { _user = new Login(); _UserClientServiceProxy = new UserControllerClientProxy(); }