Пример #1
0
        public static void False(bool condition)
        {
#if XUNIT
            FrameworkAssert.False(condition);
#else
            FrameworkAssert.IsFalse(condition);
#endif
        }
Пример #2
0
        public void ShouldReturnIsEnabled()
        {
            var ele1 = driver.FindElementById("input__search");

            A.True(ele1.IsEnabled);

            var ele2 = driver.FindElementById("input__search_disabled");

            A.False(ele2.IsEnabled);
        }
Пример #3
0
        public void ShouldReturnDisplayState()
        {
            var ele1 = driver.FindElementById("input__search");

            A.True(ele1.IsDisplayed);

            var ele2 = driver.FindElementById("input__search_hidden");

            A.False(ele2.IsDisplayed);
        }
Пример #4
0
        public void ShouldAcceptAlert()
        {
            driver.Get("/input.html");
            driver.ExecuteScript("window.setTimeout(function(){window.res=window.confirm('test dismiss');}, 100);");
            var alert = driver.SwitchToAlert();

            A.AreEqual("test dismiss", alert.Text);
            alert.Dismiss();
            A.False((bool)driver.ExecuteScript("return window.res;"));
            A.Null(driver.SwitchToAlert(0, false));
        }
Пример #5
0
        public void CanValidateWrongData()
        {
            // Arrange
            ValidatorTestObject validatorTestObject = new ValidatorTestObject {
            };

            // Act
            bool actual = this.validator.IsValid(validatorTestObject);

            // Assert
            Assert.False(actual);
        }
Пример #6
0
        public void CanValidateAndDectectWrongData()
        {
            // Arrange
            YummySausageSalad yummySausageSalad = new YummySausageSalad {
                Name = "123456", Optional = "Test"
            };
            Validator <YummySausageSalad> validator = new Validator <YummySausageSalad>();

            // Act
            bool actual = validator.IsValid(yummySausageSalad);

            // Assert
            Assert.False(actual);
        }
Пример #7
0
        public void ShouldReturnSelectedState()
        {
            var ele1 = driver.FindElementById("checkbox1");

            A.False(ele1.IsSelected);

            var ele2 = driver.FindElementById("checkbox2");

            A.True(ele2.IsSelected);

            var ele3 = driver.FindElementById("select_item2");

            A.True(ele2.IsSelected);
        }
Пример #8
0
        public void Verify_Config_Not_Correct_Period()
        {
            ConfigEntity.Period = 0;
            var configEntityList = new List <ConfigEntity> {
                ConfigEntity
            };
            var mockLogger = new Mock <ILogger>();

            mockLogger.Setup(x => x.LogAsync(It.IsAny <LogParams>())).Returns(Task.CompletedTask);

            var serviceProvider = new ServiceCollection()
                                  .AddSingleton <IConfigVerifier>(p => new ConfigVerifier(mockLogger.Object))
                                  .BuildServiceProvider();

            var configVerifier = serviceProvider.GetService <IConfigVerifier>();
            var result         = configVerifier.Verify(configEntityList);

            Assert.False(result);
        }