public void GEDCOMDocument_SelectChildsFamilyRecord_Throws_On_Null_Or_Empty_ChildId(string fileName, string childId)
        {
            //Arrange
            var document = new GEDCOMDocument();

            document.LoadGEDCOM(GetEmbeddedFileString(fileName));

            //Act, Assert
            Assert.Throws <ArgumentNullException>(() => document.SelectChildsFamilyRecord(childId));
        }
        public void GEDCOMDocument_SelectFamilyRecord_Throws_On_Null_WifeId(string fileName, string husbandId, string wifeId)
        {
            //Arrange
            var document = new GEDCOMDocument();

            document.LoadGEDCOM(GetEmbeddedFileString(fileName));

            //Act, Assert
            Assert.Throws <ArgumentNullException>(() => document.SelectFamilyRecord(husbandId, wifeId));
        }
        public void GEDCOMDocument_SelectFamilyRecords_Throws_On_Null_Or_Empty_IndividualId(string fileName, string individualId)
        {
            //Arrange
            var document = new GEDCOMDocument();

            document.LoadGEDCOM(GetEmbeddedFileString(fileName));

            //Act, Assert
            Assert.Throws <ArgumentException>(() => document.SelectFamilyRecords(individualId));
        }
Example #4
0
        public void GEDCOMDocument_LoadGEDCOM_Loads_Document_With_Individuals(string fileName, int recordCount)
        {
            //Arrange
            var document = new GEDCOMDocument();

            //Act
            document.LoadGEDCOM(GetEmbeddedFileString(fileName));

            //Assert
            Assert.AreEqual(recordCount, document.IndividualRecords.Count);
        }
        public void GEDCOMDocument_SelectChildsFamilyRecord_Returns_Null_When_Given_InValid_ChildId(string fileName, string childId)
        {
            //Arrange
            var document = new GEDCOMDocument();

            document.LoadGEDCOM(GetEmbeddedFileString(fileName));

            //Act
            var record = document.SelectChildsFamilyRecord(childId);

            //Assert
            Assert.IsNull(record);
        }
        public void GEDCOMDocument_SelectFamilyRecords_Returns_List_Of_Families(string fileName, string individualId, int recordCount)
        {
            //Arrange
            var document = new GEDCOMDocument();

            document.LoadGEDCOM(GetEmbeddedFileString(fileName));

            //Act
            var records = document.SelectFamilyRecords(individualId);

            //Assert
            Assert.AreEqual(recordCount, records.Count());
        }
        public void GEDCOMDocument_SelectFamilyRecord_Returns_Null_When_Given_InValid_HusbandId_Or_WifeId(string fileName, string husbandId, string wifeId)
        {
            //Arrange
            var document = new GEDCOMDocument();

            document.LoadGEDCOM(GetEmbeddedFileString(fileName));

            //Act
            var record = document.SelectFamilyRecord(husbandId, wifeId);

            //Assert
            Assert.IsNull(record);
        }
        public void GEDCOMDocument_SelectIndividualRecord_Returns_Null_When_Given_InValid_Id(string fileName, int recordNo)
        {
            //Arrange
            var document = new GEDCOMDocument();

            document.LoadGEDCOM(GetEmbeddedFileString(fileName));
            string id = String.Format("@I{0}@", recordNo);

            //Act
            var record = document.SelectIndividualRecord(id);

            //Assert
            Assert.IsNull(record);
        }
        public void GEDCOMDocument_SelectFamilyRecord_Returns_Family_When_Given_Valid_Id(string fileName, string familyId)
        {
            //Arrange
            var document = new GEDCOMDocument();

            document.LoadGEDCOM(GetEmbeddedFileString(fileName));

            //Act
            var record = document.SelectFamilyRecord(familyId);

            //Assert
            Assert.IsNotNull(record);
            Assert.AreEqual(record.Id, familyId);
        }
        public void GEDCOMDocument_SelectFamilyRecords_Returns_Family_When_Given_Valid_WifeId(string fileName, string wifeId, string familyId)
        {
            //Arrange
            var document = new GEDCOMDocument();

            document.LoadGEDCOM(GetEmbeddedFileString(fileName));
            string husbandId = String.Empty;

            //Act
            var record = document.SelectFamilyRecords(wifeId).SingleOrDefault();

            //Assert
            Assert.IsNotNull(record);
            Assert.AreEqual(record.Id, familyId);
        }