public void CurentUser_after_Authentification() { //Arrange _directoryService.TryAddUser(new User() { Login = "******", Role = "user" }); var user = _directoryService.GetUsers().Single(); UserController.ControllerContext = ControllerContextAuthentificator.Authentificate(user); //Act var responce = UserController.Current(); //Assert Assert.IsTrue(responce.Value.Login == user.Login); }
public void PostOrder_after_Authentificate() { //Arrange string productName = "someProd"; string description = "some details"; OrderController.ControllerContext = ControllerContextAuthentificator.Authentificate(DefaultUser); //Act var responce = OrderController.Post(new Order() { Product = productName, ProductDescription = description }); //Assert var order = _orderDirectoryService.GetAllOrders().Single(); Assert.IsTrue(responce.Value.Product == productName); Assert.IsTrue(order.Product == productName); }