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

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

            //Act
            myDispute.AddUserReplacementvalue("", "522bb79455449d881b004d27");
        }
コード例 #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());
        }
コード例 #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());
        }
コード例 #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());
        }