public void EditCompanyContactSuccess()
        {
            // Arrange
            IRepAddressBook      rep         = new RepAddressBook();
            FakeConsoleInterface fakeConsole = new FakeConsoleInterface(
                new List <string>
            {
                "1",
                "1",
                "1",
                "Name 1",
                "Address 1",
                "1243545462",
                "www.google.com",
                "",
                "3",
                "1",
                "Name 2",
                "Address 2",
                "1243545462",
                "www.google.com",
                "",
                "5"
            });
            AddressBookService target = new AddressBookService(fakeConsole, rep);

            // act
            target.Start();

            // asset
            StringAssert.Contains(fakeConsole.Output, Constants.Messages.SuccessfullyUpdated);
        }
        public void AddCompanyContactInvalidNameSuccess()
        {
            // Arrange
            IRepAddressBook      rep         = new RepAddressBook();
            FakeConsoleInterface fakeConsole = new FakeConsoleInterface(
                new List <string>
            {
                "1",
                "1",
                "1",
                "",
                "Name 1",
                "Address 1",
                "1243545462",
                "www.google.com",
                "",
                "5"
            });
            AddressBookService target = new AddressBookService(fakeConsole, rep);

            // act
            target.Start();

            // asset
            Assert.IsNotNull(rep.SearchByTaxID("1"));
            StringAssert.Contains(fakeConsole.Output, String.Format(Constants.Messages.FieldCannotBeNull, "Name"));
        }
        public void DeleteContactSuccess()
        {
            // Arrange
            IRepAddressBook      rep         = new RepAddressBook();
            FakeConsoleInterface fakeConsole = new FakeConsoleInterface(
                new List <string>
            {
                "1",
                "3",
                "1",
                "Name 1",
                "Address 1",
                "1243545462",
                "01/01/1999",
                "email",
                "",
                "4",
                "1",
                "",
                "5"
            });
            AddressBookService target = new AddressBookService(fakeConsole, rep);

            // act
            target.Start();

            // asset
            StringAssert.Contains(fakeConsole.Output, String.Format(Constants.Messages.SuccessfullyDeleted));
        }
        public void AddFriendContactTestSuccess()
        {
            // Arrange
            IRepAddressBook      rep         = new RepAddressBook();
            FakeConsoleInterface fakeConsole = new FakeConsoleInterface(
                new List <string>
            {
                "1",
                "3",
                "1",
                "Name 1",
                "Address 1",
                "1243545462",
                "01/01/1999",
                "email",
                "",
                "5"
            });
            AddressBookService target = new AddressBookService(fakeConsole, rep);

            // act
            target.Start();

            // asset
            Assert.IsNotNull(rep.SearchByTaxID("1"));
            StringAssert.Contains(fakeConsole.Output, Constants.Messages.SuccessfullyAdded);
        }
        public void AddWorkContactTestInvalidTitle()
        {
            // Arrange
            IRepAddressBook      rep         = new RepAddressBook();
            FakeConsoleInterface fakeConsole = new FakeConsoleInterface(
                new List <string>
            {
                "1",
                "2",
                "1",
                "Name 1",
                "Address 1",
                "1243545462",
                "www.google.com",
                "Emp",
                "email",
                "NON",
                "",
                "NOnE",
                "",
                "5"
            });
            AddressBookService target = new AddressBookService(fakeConsole, rep);

            // act
            target.Start();

            // asset
            Assert.IsNotNull(rep.SearchByTaxID("1"));
            StringAssert.Contains(fakeConsole.Output, Constants.Messages.InvalidTitle);
        }
        public void AddCompanyContactUniqueTaxIDSuccess()
        {
            // Arrange
            IRepAddressBook      rep         = new RepAddressBook();
            FakeConsoleInterface fakeConsole = new FakeConsoleInterface(
                new List <string>
            {
                "1",
                "1",
                "1",
                "Name 1",
                "Address 1",
                "1243545462",
                "www.google.com",
                "",
                "1",
                "1",
                "1",
                "",
                "2",
                "Name 1",
                "Address 1",
                "1243545462",
                "www.google.com",
                "",
                "5"
            });
            AddressBookService target = new AddressBookService(fakeConsole, rep);

            // act
            target.Start();

            // asset
            StringAssert.Contains(fakeConsole.Output, Constants.Messages.taxIDAlreadyExsists);
        }
        public void MainMenuInvalidSelectionFail()
        {
            // Arrange
            IRepAddressBook      rep         = new RepAddressBook();
            FakeConsoleInterface fakeConsole = new FakeConsoleInterface(
                new List <string>
            {
                "dddddee8766",
                "",
                "5"
            });
            AddressBookService target = new AddressBookService(fakeConsole, rep);

            // act
            target.Start();

            // asset
            StringAssert.Contains(fakeConsole.Output, Constants.Messages.InvalidCommand);
        }
        public void DeleteFailContactNotFound()
        {
            // Arrange
            IRepAddressBook      rep         = new RepAddressBook();
            FakeConsoleInterface fakeConsole = new FakeConsoleInterface(
                new List <string>
            {
                "4",
                "1",
                "",
                "5"
            });
            AddressBookService target = new AddressBookService(fakeConsole, rep);

            // act
            target.Start();

            // asset
            StringAssert.Contains(fakeConsole.Output, String.Format(Constants.Messages.ContactNotFound));
        }
        public void SearchContactByNameFailContactNotFound()
        {
            // Arrange
            IRepAddressBook      rep         = new RepAddressBook();
            FakeConsoleInterface fakeConsole = new FakeConsoleInterface(
                new List <string>
            {
                "2",
                "2",
                "Name 1",
                "",
                "5"
            });
            AddressBookService target = new AddressBookService(fakeConsole, rep);

            // act
            target.Start();

            // asset
            StringAssert.Contains(fakeConsole.Output, Constants.Messages.ContactNotFound);
        }