Ejemplo n.º 1
0
        public async void TestGetOrgConfigTypeAsync()
        {
            //Arrange
            var mockConfigService = new Mock <IConfigService>();

            mockConfigService.Setup(service => service.GetOrganizationsAsync()).ReturnsAsync(GetOrganizationObject());

            var orgController = new OrganizationsController();

            //Act
            var actual = await orgController.GetOrgConfigAsync(mockConfigService.Object);

            //Assert
            Assert.IsType <Organization>(actual.Value.ElementAt(0));
        }
Ejemplo n.º 2
0
        public async void TestGetOrgConfigNotNullAsync()
        {
            //Arrange
            var mockConfigService = new Mock <IConfigService>();

            mockConfigService.Setup(service => service.GetOrganizationsAsync()).ReturnsAsync(GetOrganizationObject());

            var orgController = new OrganizationsController();

            //Act
            var actual = await orgController.GetOrgConfigAsync(mockConfigService.Object);

            //Assert
            mockConfigService.VerifyAll();
            Assert.NotNull(actual);
        }
Ejemplo n.º 3
0
        public async void TestOrgNameAndOrgIdAsync()
        {
            //Arrange
            var mockConfigService = new Mock <IConfigService>();

            mockConfigService.Setup(service => service.GetOrganizationsAsync()).ReturnsAsync(GetOrganizationObject());

            var orgController = new OrganizationsController();
            var expected      = GetOrganizationObject();

            //Act
            var actual = await orgController.GetOrgConfigAsync(mockConfigService.Object);

            //Assert
            Assert.True(actual.Value.ElementAt(0).OrgId == expected.ElementAt(0).OrgId&&
                        actual.Value.ElementAt(0).OrgName == expected.ElementAt(0).OrgName);
        }