Exemple #1
0
        public async Task GetManagersSucceedsWithHttpResponseMessage200()
        {
            // Arrange

            var client = new Client
            {
                ClientId  = 1,
                Level     = 2,
                UserId    = 2,
                ManagerId = 1
            };
            var manager = new Manager
            {
                ManagerId = 1,
                Position  = Position.Senior,
                UserId    = 1,
                Clients   = new List <Client> {
                    client
                }
            };

            var managerList = new List <Manager> {
                manager
            };

            _managerServiceMock.Setup(x => x.GetManagers()).Returns(Task.FromResult(managerList));

            // Act
            var returnObject = await _controller.Managers();

            var actualResult = (OkObjectResult)returnObject;

            // Assert
            Assert.AreEqual(200, actualResult.StatusCode);
        }