Esempio n. 1
0
        public void SaveNewObjectWithScalars()
        {
            var person = CreateNewTransientPerson();

            person.Name = Guid.NewGuid().ToString();
            var adapter = Save(person);

            Assert.IsTrue(adapter.ResolveState.IsPersistent(), "should be persistent");
            Assert.IsFalse(adapter.Oid.IsTransient, "is transient");
        }
Esempio n. 2
0
        public void ContinentIsRuledByPlayer()
        {
            var list = new List <string> {
                "TestName", "TestName", "TestName", "TestName"
            };

            var result = ArmyBuilder.CheckContinentForRuler(list, "TestName");

            Assert.IsTrue(result);
        }
Esempio n. 3
0
        public void ReadWriteProperty_IsBBS()
        {
            vCardPhone phone = new vCardPhone();

            phone.IsBBS = true;
            Assert.IsTrue(phone.IsBBS, "IsBBS should have been set to true.");

            phone.IsBBS = false;
            Assert.IsFalse(phone.IsBBS, "IsBBS should have been set to false.");
        }
Esempio n. 4
0
        public void ComparesArgumentForEqualityToExpectedObject()
        {
            Matcher matcher = new EqualMatcher(EXPECTED);

            Assert.IsTrue(matcher.Matches(EXPECTED), "same object");
#if !SILVERLIGHT
            Assert.IsTrue(matcher.Matches(EXPECTED.Clone()), "equal object");
#endif
            Assert.IsFalse(matcher.Matches("not expected"), "unequal object");
        }
Esempio n. 5
0
File: To.cs Progetto: vebin/IQMap
        public void Simple()
        {
            Dog target = new Dog();

            var firstDog = IQ.From <Dog>().To(target).ElementAt(1);

            Assert.AreEqual("Bulldog", firstDog.Breed, "The output object was correct");
            Assert.AreEqual("Bulldog", target.Breed, "The existing target object was correct");
            Assert.IsTrue(ReferenceEquals(firstDog, target));
        }
Esempio n. 6
0
        public void ReadWriteProperty_IsMessagingService()
        {
            vCardPhone phone = new vCardPhone();

            phone.IsMessagingService = true;
            Assert.IsTrue(phone.IsMessagingService, "IsMessagingService should have been set to true.");

            phone.IsMessagingService = false;
            Assert.IsFalse(phone.IsMessagingService, "IsMessagingService should have been set to false.");
        }
Esempio n. 7
0
        public void ReturnArrayTest()
        {
            _mock.Expects.One.MethodWith(_ => _.ReturnArray("value")).Will(Return.Value(new int[] {}));
            _mock.Expects.One.MethodWith(_ => _.ReturnArray("value")).WillReturn(new int[] {});

            _driver.Go("array", "value");
            _driver.Go("array", "value");

            Assert.IsTrue(true);
        }
        public void TestRequiredFieldHappyPathForInheritedClass()
        {
            RequiredFieldBase inheritedObject = new RequiredFieldDerived()
            {
                BaseStringType     = "Payments",
                DerivedIntegerType = 10
            };

            Assert.IsTrue(SwagValidator.Validate(inheritedObject));
        }
Esempio n. 9
0
        public void ReturnStringTest()
        {
            _mock.Expects.One.MethodWith(_ => _.ReturnString("value")).Will(Return.Value("hello"));
            _mock.Expects.One.MethodWith(_ => _.ReturnString("value")).WillReturn("hello");

            _driver.Go("string", "value");
            _driver.Go("string", "value");

            Assert.IsTrue(true);
        }
Esempio n. 10
0
        public void ReturnStructTest()
        {
            _mock.Expects.One.MethodWith(_ => _.ReturnStruct("value")).Will(Return.Value(new TestStruct()));
            _mock.Expects.One.MethodWith(_ => _.ReturnStruct("value")).WillReturn(new TestStruct());

            _driver.Go("struct", "value");
            _driver.Go("struct", "value");

            Assert.IsTrue(true);
        }
Esempio n. 11
0
        public void ReturnInterfaceTest()
        {
            _mock.Expects.One.MethodWith(_ => _.ReturnInterface("value")).Will(Return.Value(new ReturnValue()));
            _mock.Expects.One.MethodWith(_ => _.ReturnInterface("value")).WillReturn(new ReturnValue());

            _driver.Go("interface", "value");
            _driver.Go("interface", "value");

            Assert.IsTrue(true);
        }
        public void AuthorizedScopeTask()
        {
            data.Scope = scope;
            azman      = new AzManAuthorizationProvider(data.StoreLocation, data.Application, data.AuditIdentifierPrefix, data.Scope);

            string task = "Manage Extranet";
            bool   res  = azman.Authorize(cryptographyProviderCollection, task);

            Assert.IsTrue(res);
        }
Esempio n. 13
0
        public void SetReturnsTrueWhenCalledWithDifferentValue()
        {
            var dummy           = CreateUnitUnderTest();
            int target          = 0;
            var valueWasChanged = dummy.SetSurrogate(ref target, 42, () => dummy.MyProperty, false);

            dummy.MyProperty = 42;

            Assert.IsTrue(valueWasChanged);
        }
Esempio n. 14
0
        public void SetPlayerListMethodTest()
        {
            GameBoard.GetBoard().SetPlayerList(MockBuilder.GetPlayerList());
            var rnd      = GameBoard.GetBoard().GetRandom();
            var index    = rnd.Next(0, 5);
            var list     = GameBoard.GetBoard().GetPlayerList();
            var testList = MockBuilder.GetPlayerList();

            Assert.IsTrue(list[index].Name == testList[index].Name);
        }
Esempio n. 15
0
        public void ReturnBoolTest()
        {
            _mock.Expects.One.MethodWith(_ => _.ReturnBool("value")).Will(Return.Value(true));
            _mock.Expects.One.MethodWith(_ => _.ReturnBool("value")).WillReturn(true);

            _driver.Go("bool", "value");
            _driver.Go("bool", "value");

            Assert.IsTrue(true);
        }
        public void TestIfMulIsEqualToComplexOperator()
        {
            var z1 = new Complex(1.6859, 0.3902);
            var z2 = new Complex(3.51896, -0.458);

            var w1 = z1 * z2;
            var w2 = ComplexArithmetic.Multiply(z1, z2);

            Assert.IsTrue(w1.ApproximatelyEquals(w2, Epsilon));
        }
Esempio n. 17
0
        public void ReturnEnumTest()
        {
            _mock.Expects.One.MethodWith(_ => _.ReturnEnum("value")).Will(Return.Value(TestValues.Second));
            _mock.Expects.One.MethodWith(_ => _.ReturnEnum("value")).WillReturn(TestValues.Second);

            _driver.Go("enum", "value");
            _driver.Go("enum", "value");

            Assert.IsTrue(true);
        }
        public void ObjectWithNestedClassNotRequired()
        {
            var obj1 = new SomeObjectWithNestedClassWithoutRequired()
            {
                SomethingElse         = "something",
                ThisIsNotARequiredObj = null  //since this is not required this should not throw error
            };

            Assert.IsTrue(SwagValidator.Validate(obj1));
        }
Esempio n. 19
0
        public void ReturnIntTest()
        {
            _mock.Expects.One.MethodWith(_ => _.ReturnInt("value")).Will(Return.Value(3));
            _mock.Expects.One.MethodWith(_ => _.ReturnInt("value")).WillReturn(3);

            _driver.Go("int", "value");
            _driver.Go("int", "value");

            Assert.IsTrue(true);
        }
Esempio n. 20
0
 public void TryLogInWithNotExistingUser()
 {
     mainPage.Navigate();
     mainPage.LoginButtonClick();
     helper.CookieBannerClick();
     loginPage.UserFieldSendKey("*****@*****.**");
     loginPage.PasswordFieldSendKey("12Qwerty");
     loginPage.LogInButtonClick();
     Assert.IsTrue(helper.WarningButtonExists());
 }
Esempio n. 21
0
        public void GetFactors()
        {
            //Assert.IsTrue((Fraction)"3/4" is Fraction);

            foreach (long fact in Get.Factors(2003))
            {
                Debug.WriteLine("factor: " + fact);
            }
            Assert.IsTrue(Check.IsPrime(2003) == true);
        }
Esempio n. 22
0
        public void ReadWriteProperty_IsPreferred()
        {
            vCardPhone phone = new vCardPhone();

            phone.IsPreferred = true;
            Assert.IsTrue(phone.IsPreferred, "IsPreferred should have been set to true.");

            phone.IsPreferred = false;
            Assert.IsFalse(phone.IsPreferred, "IsPreferred should have been set to false.");
        }
Esempio n. 23
0
        public void ValidateImageSize()
        {
            var result = JArray.Parse(File.ReadAllText(JSONS_PATH + "Msp.json")).Select(x => new { Thumbnail = x["thumbnail"].ToString(), Image = x["image"].ToString(), Name = x["name"] + " " + x["lastname"] });

            foreach (var msp in result)
            {
                Assert.IsTrue(CheckSquareImage(msp.Thumbnail), "Thumbnail for " + msp.Name + " is not valid!");
                Assert.IsTrue(CheckSquareImage(msp.Image), "Image for " + msp.Name + " is not valid!");
            }
        }
Esempio n. 24
0
        public void ReadWriteProperty_IsCellular()
        {
            vCardPhone phone = new vCardPhone();

            phone.IsCellular = true;
            Assert.IsTrue(phone.IsCellular, "IsCellular should have been set to true.");

            phone.IsCellular = false;
            Assert.IsFalse(phone.IsCellular, "IsCellular should have been set to false.");
        }
        public void TestIfPowIntInFasterThanPow()
        {
            const int iter = 250000;

            var z = new Complex(1.6859, 0.3902);
            var averageIntTime = BenchmarkUtil.Benchmark(() => { ComplexArithmetic.PowInt(z, 10); }, iter);
            var averageCpTime  = BenchmarkUtil.Benchmark(() => { Complex.Pow(z, 10); }, iter);

            Assert.IsTrue(averageIntTime < averageCpTime);
        }
Esempio n. 26
0
        public void SetPlayerTurnQueueMethodTest()
        {
            GameBoard.GetBoard().SetPlayerTurnQueue(MockBuilder.GetPlayerQueue());
            var rnd       = GameBoard.GetBoard().GetRandom();
            var index     = rnd.Next(0, 5);
            var queue     = GameBoard.GetBoard().GetPlayerList();
            var testQueue = MockBuilder.GetPlayerList();

            Assert.IsTrue(queue[index].Name == testQueue[index].Name);
        }
Esempio n. 27
0
        public void Clone()
        {
            var item  = new OrderByItem("field1", SortOrder.Descending);
            var clone = item.Clone();

            Assert.IsTrue(item.Equals(clone));
            clone.Reverse();
            Assert.IsFalse(item.Equals(clone));
            clone.Reverse();
            Assert.IsTrue(item.Equals(clone));
        }
Esempio n. 28
0
        public void IsHittableTests()
        {
            // new ship
            var ship = new Ship(new [] {4, 5, 3});

            Assert.IsTrue(ship.IsHittable(3));
            Assert.IsTrue(ship.IsHittable(4));
            Assert.IsTrue(ship.IsHittable(5));
            Assert.IsFalse(ship.IsHittable(-1));
            Assert.IsFalse(ship.IsHittable(6));
        }
Esempio n. 29
0
        public void TestCheckMapIsFull()
        {
            var board = GameBoard.GetBoard();

            foreach (var territory in board.GetEarth().Territories)
            {
                territory.Occupant = "TestName";
            }

            Assert.IsTrue(BoardPopulator.CheckMapIsFull(board));
        }
Esempio n. 30
0
        public void TestingExtensionMethods()
        {
            const int a = 3;

            Assert.IsTrue(a.IsPositive());
            Assert.IsFalse(a.IsNegative());

            const int b = 6;

            Assert.IsTrue(b.IsDivisible(3));
        }