当前位置: 首页>>代码示例>>C#>>正文


C# IAssert类代码示例

本文整理汇总了C#中IAssert的典型用法代码示例。如果您正苦于以下问题:C# IAssert类的具体用法?C# IAssert怎么用?C# IAssert使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IAssert类属于命名空间,在下文中一共展示了IAssert类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Execute

        public override void Execute(IAssert assert)
        {
            var data = SetUp();
            var typesToTest = GetTypesToTest(data);
            if (typesToTest.Length == 0)
            {
                assert.Inconclusive(
                    "No types found to apply the convention to. Make sure the Types predicate is correct and that the right assemblies to scan are specified.");
            }
            var invalidItems = Array.FindAll(typesToTest, t => data.Must(t) == false);

            var message = new StringBuilder();
            message.AppendLine(data.Description ?? "Invalid types found");
            foreach (var invalidType in invalidItems)
            {
                message.Append('\t');
                data.ItemDescription(invalidType, message);
            }
            if (data.HasApprovedExceptions)
            {
                Approve(message.ToString());
            }
            else
            {
                assert.AreEqual(0, invalidItems.Count(), message.ToString());
            }
        }
开发者ID:MehdiK,项目名称:ConventionTests,代码行数:27,代码来源:ConventionTest.cs

示例2: TestAttributionHandler

 public TestAttributionHandler(DeviceUtil deviceUtil, IAssert assert, TargetPlatform targetPlatform)
     : base(deviceUtil, assert)
 {
     TargetPlatform = targetPlatform;
     TestActivityPackage.Assert = Assert;
     TestActivityPackage.TargetPlatform = TargetPlatform;
 }
开发者ID:adjust,项目名称:windows_sdk,代码行数:7,代码来源:TestAttributionHandler.cs

示例3: CategoryTestA

        public CategoryTestA(IAssert assert, ICategorize categorize)
        {
            _assert = assert;

            categorize.Method("Functional", TestMethodA);
            categorize.Method("Functional", TestMethodB);
        }
开发者ID:hach-que,项目名称:Prototest,代码行数:7,代码来源:CategoryTestA.cs

示例4: CPlusPlusSWIGBindingGeneratorWorksTest

        public CPlusPlusSWIGBindingGeneratorWorksTest(IAssert assert, ICategorize categorize)
            : base(assert)
        {
            _assert = assert;

            categorize.Method("CPlusPlusPotentialSWIGInstallation", () => GenerationIsCorrect());
        }
开发者ID:marler8997,项目名称:Protobuild,代码行数:7,代码来源:CPlusPlusSWIGBindingGeneratorWorksTest.cs

示例5: CPlusPlusExternalPlatformReferenceWorksTest

        public CPlusPlusExternalPlatformReferenceWorksTest(IAssert assert, ICategorize categorize)
            : base(assert)
        {
            _assert = assert;

            categorize.Method("CPlusPlusPotentialSWIGInstallation", () => GenerationIsCorrect());
        }
开发者ID:marler8997,项目名称:Protobuild,代码行数:7,代码来源:CPlusPlusExternalPlatformReferenceWorksTest.cs

示例6: Init

 public static void Init(ILogger logger = null, IAssert assert = null,
     TimeoutSettings timeouts = null, IDriver<IWebDriver> driverFactory = null)
 {
     DriverFactory = driverFactory ?? new WebDriverFactory();
     Asserter = assert ?? new WebAssert();
     Timeouts = timeouts ?? new WebTimeoutSettings();
     Logger = logger ?? new LogAgregator(new NUnitLogger(), new Log4Net());
     MapInterfaceToElement.Init(DefaultInterfacesMap);
 }
开发者ID:epam,项目名称:JDI,代码行数:9,代码来源:WebSettings.cs

示例7: InitFromProperties

        public static void InitFromProperties(ILogger logger = null, IAssert assert = null,
            TimeoutSettings timeouts = null, IDriver<IWebDriver> driverFactory = null)
        {
            Init(logger, assert, timeouts, driverFactory);
            JDISettings.InitFromProperties();
            FillFromSettings(p => Domain = p, "Domain");
            FillFromSettings(p => DriverFactory.DriverPath = p, "DriversFolder");

            // FillFromSettings(p => DriverFactory.DriverVersion = p, "DriversVersion");
            // fillAction(p->getDriverFactory().getLatestDriver =
            //        p.toLowerCase().equals("true") || p.toLowerCase().equals("1"), "driver.getLatest");
            // fillAction(p->asserter.doScreenshot(p), "screenshot.strategy");
            FillFromSettings(p =>
            {
                p = p.ToLower();
                if (p.Equals("soft"))
                    p = "any,multiple";
                if (p.Equals("strict"))
                    p = "visible,single";
                if (p.Split(',').Length != 2) return;
                var parameters = p.Split(',').ToList();
                if (parameters.Contains("visible") || parameters.Contains("displayed"))
                    WebDriverFactory.ElementSearchCriteria = el => el.Displayed;
                if (parameters.Contains("any") || parameters.Contains("all"))
                    WebDriverFactory.ElementSearchCriteria = el => el != null;
                if (parameters.Contains("single") || parameters.Contains("displayed"))
                    OnlyOneElementAllowedInSearch = true;
                if (parameters.Contains("multiple") || parameters.Contains("displayed"))
                    OnlyOneElementAllowedInSearch = false;
            }, "SearchElementStrategy");

            FillFromSettings(p =>
            {
                string[] split = null;
                if (p.Split(',').Length == 2)
                    split = p.Split(',');
                if (p.ToLower().Split('x').Length == 2)
                    split = p.ToLower().Split('x');
                if (split != null)
                    BrowserSize = new Size(Parse(split[0]), Parse(split[1]));
            }, "BrowserSize");
        }
开发者ID:epam,项目名称:JDI,代码行数:42,代码来源:WebSettings.cs

示例8: PlatformSpecificXSLTGenerationWorksTest

 public PlatformSpecificXSLTGenerationWorksTest(IAssert assert)
     : base(assert)
 {
     _assert = assert;
 }
开发者ID:marler8997,项目名称:Protobuild,代码行数:5,代码来源:PlatformSpecificXSLTGenerationWorksTest.cs

示例9: ModuleInfoGetsUpgradedTest

 public ModuleInfoGetsUpgradedTest(IAssert assert)
     : base(assert)
 {
     _assert = assert;
 }
开发者ID:marler8997,项目名称:Protobuild,代码行数:5,代码来源:ModuleInfoGetsUpgradedTest.cs

示例10: NuGetAndroidDoesNotCrashTest

 public NuGetAndroidDoesNotCrashTest(IAssert assert)
     : base(assert)
 {
     _assert = assert;
 }
开发者ID:marler8997,项目名称:Protobuild,代码行数:5,代码来源:NuGetAndroidDoesNotCrashTest.cs

示例11: MacOSPlatformForceAPIXamMacWorksTest

 public MacOSPlatformForceAPIXamMacWorksTest(IAssert assert)
     : base(assert)
 {
     _assert = assert;
 }
开发者ID:marler8997,项目名称:Protobuild,代码行数:5,代码来源:MacOSPlatformForceAPIXamMacWorksTest.cs

示例12: PathUtilsTests

 public PathUtilsTests(IAssert assert)
 {
     _assert = assert;
 }
开发者ID:marler8997,项目名称:Protobuild,代码行数:4,代码来源:PathUtilsTests.cs

示例13: BasicSynchronisationWorksTest

 public BasicSynchronisationWorksTest(IAssert assert)
     : base(assert)
 {
 }
开发者ID:marler8997,项目名称:Protobuild,代码行数:4,代码来源:BasicSynchronisationWorksTest.cs

示例14: ExampleCocos2DXNATest

 public ExampleCocos2DXNATest(IAssert assert)
     : base(assert)
 {
     _assert = assert;
 }
开发者ID:marler8997,项目名称:Protobuild,代码行数:5,代码来源:ExampleCocos2DXNATest.cs

示例15: IncludeProjectPropertiesWorksTest

 public IncludeProjectPropertiesWorksTest(IAssert assert)
     : base(assert)
 {
     _assert = assert;
 }
开发者ID:marler8997,项目名称:Protobuild,代码行数:5,代码来源:IncludeProjectPropertiesWorksTest.cs


注:本文中的IAssert类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。