public void ChooseRotors_ShouldReturn400_WhenPassedRotorsABC() { // Arrange var controller = new EnigmaController(); controller.Request = new HttpRequestMessage(); // Act HttpResponseMessage message = controller.ChooseRotors("ABC"); // Assert Assert.AreEqual(HttpStatusCode.BadRequest, message.StatusCode); }
public void SetRotor_ShouldReturn200Ok_WhenSettingIncorrectRotor() { // Arrange var controller = new EnigmaController(); controller.Request = new HttpRequestMessage(); string jsonRotor = @" { 'RotorNum':4, 'Setting':'k' }"; HttpResponseMessage message = controller.ChooseRotors("123"); // Act message = controller.SetRotor(JsonConvert.DeserializeObject <RotorDto>(jsonRotor), 2); // Assert Assert.AreEqual(HttpStatusCode.OK, message.StatusCode); }