예제 #1
0
        public void Emails_With_Plus_And_Dots_Should_Handle_Properly()
        {
            // Arrange
            var solution = new UniqueEmailAddressesSolution();

            //act
            var result = solution.NumUniqueEmails(new string[] { "*****@*****.**", "*****@*****.**" });

            //Assert
            Assert.Equal(1, result);
        }
예제 #2
0
        public void Empty_Collection_Should_Return_0()
        {
            // Arrange
            var solution = new UniqueEmailAddressesSolution();

            //act
            var result = solution.NumUniqueEmails(new string[] { });

            //Assert
            Assert.Equal(0, result);
        }
예제 #3
0
        public void Different_Emails_Should_Handle_Properly()
        {
            // Arrange
            var solution = new UniqueEmailAddressesSolution();

            //act
            var result = solution.NumUniqueEmails(new string[]
                                                  { "*****@*****.**", "testemail@leet+code.com", "*****@*****.**" });

            //Assert
            Assert.Equal(2, result);
        }
예제 #4
0
        public void All_Same_Emails_Should_Return_1()
        {
            // Arrange
            var solution = new UniqueEmailAddressesSolution();

            //act
            var result = solution.NumUniqueEmails(new string[]
                                                  { "*****@*****.**", "*****@*****.**", "*****@*****.**" });

            //Assert
            Assert.Equal(1, result);
        }