Пример #1
0
        [Test] // Whether AreYou Method is ignoring casing when comparing identifiers
        public void TestAreYouCaseSensitive()
        {
            IdentifiableObject testIdentifiableObject = new IdentifiableObject(new string[] { "fred", "bob" });
            bool actual   = testIdentifiableObject.AreYou("fReD");
            bool expected = true;

            Assert.AreEqual(expected, actual, "AreYou() is exhibiting Case Sensitivity when casing should be ignored.");
        }
Пример #2
0
        [Test] // Whether FirstId method is returning first identifier in list
        public void FirstIdGetTest()
        {
            IdentifiableObject testIdentifiableObject = new IdentifiableObject(new string[] { "fred", "bob" });
            string             actual   = testIdentifiableObject.Firstid;
            string             expected = "fred";

            Assert.AreEqual(expected, actual, "FirstId is not returning the correct value.");
        }
Пример #3
0
        [Test] // Whether AreYou Method is returning TRUE for positive match
        public void TestAreYou()
        {
            IdentifiableObject testIdentifiableObject = new IdentifiableObject(new string[] { "fred", "bob" });
            bool actual   = testIdentifiableObject.AreYou("fred");
            bool expected = true;

            Assert.AreEqual(expected, actual, "AreYou() is not identifying matches correctly.");
        }
Пример #4
0
        [Test] // Whether AreYou Method is returning FALSE for negative match
        public void TestAreYouNot()
        {
            IdentifiableObject testIdentifiableObject = new IdentifiableObject(new string[] { "fred", "bob" });
            bool actual   = testIdentifiableObject.AreYou("andrew");
            bool expected = false;

            Assert.AreEqual(expected, actual, "AreYou() has returned a false positive");
        }
        public void TestAddID()
        {
            IdentifiableObject TestObject = new IdentifiableObject (new string[] {"fred", "bob"});

            TestObject.AddIdentifier ("wilma");

            Assert.IsTrue (TestObject.AreYou("fred"));
            Assert.IsTrue (TestObject.AreYou("bob"));
            Assert.IsTrue (TestObject.AreYou("wilma"));
        }
        public void TestAddID()
        {
            IdentifiableObject TestObject = new IdentifiableObject(new string[] { "fred", "bob" });

            TestObject.AddIdentifier("wilma");

            Assert.IsTrue(TestObject.AreYou("fred"));
            Assert.IsTrue(TestObject.AreYou("bob"));
            Assert.IsTrue(TestObject.AreYou("wilma"));
        }
Пример #7
0
        [Test] // Whether AddId will add passed identifier to the list
        public void AddIdentifierTest()
        {
            IdentifiableObject testIdentifiableObject = new IdentifiableObject(new string[] { "fred", "bob" });

            testIdentifiableObject.AddIdentifier("james");
            bool actual   = testIdentifiableObject.AreYou("james");
            bool expected = true;

            Assert.AreEqual(expected, actual, "AddIdentifier() has not added an Identifier to the list.");
        }
        public void TestAreYou()
        {
            IdentifiableObject TestObject = new IdentifiableObject (new string[] {"fred", "bob"});

            Assert.IsTrue (TestObject.AreYou("fred"));
            Assert.IsTrue (TestObject.AreYou("bob"));
            Assert.IsFalse (TestObject.AreYou("wilma"));
            Assert.IsFalse (TestObject.AreYou("boby"));
            Assert.IsFalse (TestObject.AreYou("Fred"));
            Assert.IsFalse (TestObject.AreYou("BOB"));
        }
        public void TestAreYou()
        {
            IdentifiableObject TestObject = new IdentifiableObject(new string[] { "fred", "bob" });

            Assert.IsTrue(TestObject.AreYou("fred"));
            Assert.IsTrue(TestObject.AreYou("bob"));
            Assert.IsFalse(TestObject.AreYou("wilma"));
            Assert.IsFalse(TestObject.AreYou("boby"));
            Assert.IsFalse(TestObject.AreYou("Fred"));
            Assert.IsFalse(TestObject.AreYou("BOB"));
        }
 public void TestCaseSensitive()
 {
     IdentifiableObject id =new IdentifiableObject( new string[] { "id1", "id2" } );
     Assert.IsTrue(id.AreYou("ID1"));
 }
Пример #11
0
 public void SetUp()
 {
     _testableObject = new IdentifiableObject(new string[] { "fred", "bob" });
 }
        public void TestFirstID()
        {
            IdentifiableObject TestObject = new IdentifiableObject (new string[] {"fred", "bob"});

            Assert.IsTrue (TestObject.FirstId == "fred");
        }
        public void TestCreation()
        {
            IdentifiableObject TestObject = new IdentifiableObject (new string[] {"potato", "apple"});

            Assert.IsTrue (TestObject.FirstId == "potato");
        }
Пример #14
0
 public SwinAdventureTests()
 {
     _sa      = new Program();
     identobj = new SwinAdventure.IdentifiableObject(new string[] { "yeet", "skrrt", "yote" });
 }
        public void TestFirstID()
        {
            IdentifiableObject TestObject = new IdentifiableObject(new string[] { "fred", "bob" });

            Assert.IsTrue(TestObject.FirstId == "fred");
        }
 public void TestFirstID()
 {
     IdentifiableObject id =new IdentifiableObject( new string[] { "id1", "id2" } );
     Assert.AreEqual(id.Firstid, "id1");
 }
 public void TestYouAreNot()
 {
     IdentifiableObject id =new IdentifiableObject( new string[] { "id1", "id2" } );
     Assert.IsFalse(id.AreYou("id3"));
 }
        public void TestCreation()
        {
            IdentifiableObject TestObject = new IdentifiableObject(new string[] { "potato", "apple" });

            Assert.IsTrue(TestObject.FirstId == "potato");
        }