Example #1
0
        public void TestClassDispute_MethodAddUserReplacementvalue_ArgumentInstitutionIdIsWhiteSpace_ThrowsArgumentException()
        {
            //Arrange
            Dispute myDispute = new Dispute("Season", "Advent", "522bb79455449d881b004d27");

            //Act
            myDispute.AddUserReplacementvalue("Lent", "  ");
        }
Example #2
0
        public void TestClassDispute_MethodAddUserReplacementvalue_ArgumentReplacementValueIsEmptyString_ThrowsArgumentException()
        {
            //Arrange
            Dispute myDispute = new Dispute("Season", "Advent", "522bb79455449d881b004d27");

            //Act
            myDispute.AddUserReplacementvalue("", "522bb79455449d881b004d27");
        }
Example #3
0
        public void TestClassDispute_MethodAddUserReplacementvalue_ValueDoesNotExistAddNewReplacementValue()
        {
            //Arrange
            Dispute myDispute = new Dispute("Season", "Advent", "522bb79455449d881b004d27");
            List <ReplacementValue> expectedValue = new List <ReplacementValue>()
            {
                new ReplacementValue("Advent", "522bb79455449d881b004d27"),
                new ReplacementValue("Lent", "522bb79455449d881b004d27")
            };

            //Act
            myDispute.AddUserReplacementvalue("Lent", "522bb79455449d881b004d27");

            //Assert
            CollectionAssert.AreEqual(expectedValue.AsReadOnly(), myDispute.getReplacementValues());
        }
Example #4
0
        public void TestClassDispute_MethodAddUserReplacementvalue_ValueAlreadyExistsJustAddTheUser()
        {
            //Arrange
            Dispute myDispute = new Dispute("Season", "Advent", "522bb79455449d881b004d27");
            List <ReplacementValue> expectedValue = new List <ReplacementValue>()
            {
                new ReplacementValue("Advent", "522bb79455449d881b004d27")
            };

            expectedValue[0].AddInsitutionId("9999979455449d881b004d27");

            //Act
            myDispute.AddUserReplacementvalue("Advent", "9999979455449d881b004d27");

            //Assert
            CollectionAssert.AreEqual(expectedValue.AsReadOnly(), myDispute.getReplacementValues());
        }
Example #5
0
        public void TestClassDispute_MethodUpdateUserReplacementValue_UserReplacementValueAlreadyExists()
        {
            //Arrange
            Dispute myDispute = new Dispute("Season", "Advent", "522bb79455449d881b004d27");

            myDispute.AddUserReplacementvalue("Lent", "9999979455449d881b004d27");

            List <ReplacementValue> expectedValue = new List <ReplacementValue>()
            {
                new ReplacementValue("Advent", "522bb79455449d881b004d27"),
                new ReplacementValue("Lent", "9999979455449d881b004d27")
            };

            expectedValue[0].RemoveInstituionId("522bb79455449d881b004d27");
            expectedValue[1].AddInsitutionId("522bb79455449d881b004d27");

            //Act
            myDispute.UpdateUserReplacementValue("Lent", "Advent", "522bb79455449d881b004d27");

            //Assert are equal
            CollectionAssert.AreEqual(expectedValue.AsReadOnly(), myDispute.getReplacementValues());
        }