Example #1
0
        public void TestMethodAssertGreaterThan()
        {
            var obj1 = new DateTime(42);
            var obj2 = new DateTime(4242);

            Assert.IsTrue(StfAssert.GreaterThan("2 > 1", 2, 1));
            Assert.IsTrue(StfAssert.GreaterThan("2.0 > 1", 2.0, 1));
            Assert.IsFalse(StfAssert.GreaterThan("1 > \"2\"", 1, "2"));
            Assert.IsTrue(StfAssert.GreaterThan("1 > \"1.0\"", 1, "1.0"));

            Assert.IsFalse(StfAssert.GreaterThan("\"\" > \"\"", string.Empty, string.Empty));
            Assert.IsFalse(StfAssert.GreaterThan("\"\" > \" \"", string.Empty, " "));
            Assert.IsTrue(StfAssert.GreaterThan("\" \" > \" \"", " ", string.Empty));
            Assert.IsFalse(StfAssert.GreaterThan("\"a\" > \"A\"", "a", "A"));
            Assert.IsTrue(StfAssert.GreaterThan("\"A\" > \"a\"", "A", "a"));
            Assert.IsFalse(StfAssert.GreaterThan("\"string\" > \"string\"", "string", "string"));

            Assert.IsFalse(StfAssert.GreaterThan("obj1 = obj1", obj1, obj1));
            Assert.IsFalse(StfAssert.GreaterThan("obj1 = obj2", obj1, obj2));
            Assert.IsTrue(StfAssert.GreaterThan("obj2 = obj1", obj2, obj1));

            // fail scenarios
            Assert.IsFalse(StfAssert.GreaterThan("obj1 = 1", obj1, 1));

            // a bit funky - the object obj1 is converted to string, and then the strings are compared.
            Assert.IsTrue(StfAssert.GreaterThan("obj1 = \"string\"", obj1, "string"));
        }
Example #2
0
        public void Tc015()
        {
            // For now hard coded. TOdo: Random
            const string BrandId   = "289";
            const string BrandName = "Agossie";

            // Use default user
            WrapTrackShell.Login();
            StfAssert.IsNotNull("wrapTrackShell", WrapTrackShell);

            var randomBrand              = this.GetBrand(BrandName);
            var newPatternName           = WtUtils.GetRandomString("StfPattern");
            var baseLineNumberOfPatterns = wtApi.BrandNumberOfPatterns(BrandId);
            var patternAdded             = randomBrand.AddPattern(newPatternName);
            var numberOfPatterns         = wtApi.BrandNumberOfPatterns(BrandId);

            StfAssert.IsTrue($"Pattern {newPatternName} Added", patternAdded);
            StfAssert.GreaterThan("Number of patterns for brand up by one", numberOfPatterns, baseLineNumberOfPatterns);

            var patternDeleted = randomBrand.DeletePattern(newPatternName);

            StfAssert.IsTrue($"Pattern {newPatternName} Deleted", patternDeleted);
            numberOfPatterns = wtApi.BrandNumberOfPatterns(BrandId);
            StfAssert.AreEqual($"Number of patterns for brand as baseline", numberOfPatterns, baseLineNumberOfPatterns);
        }