Probably Mary Cassidy b. Ireland ca. 1834, d/o Patrick (ca. 1805) and 'Abbey' (Abigail?) (ca. 1805) Cassidy in the 1851 census of Fredericton, York Co., NB. Siblings include: James (ca. 1828), John (ca. 1829), Patrick (ca. 1832), Isabella (ca. 1835) and Margaret (ca. 1840.) The census indicates that Patrick arrived in NB in 1836, followed by the rest of the family in 1837 and Margaret was born in NB.
Nahum F. Foster, however, married 26JUN1853 Mary Jane Cassidy of Portland Parish, Saint John Co., NB; not of Fredericton. They were likely married in Saint John (not St. John's; that's in Newfoundland.) Unfortunately the 1851 census of Portland is no longer available. The best at the moment is that the 1865 directory indicates:
Cassidy, John Bds Bridge n Main,Indiantown Portland Saint John Liquors
Cassidy, Maurice Fort Howe Portland Saint John Laborer
it is indicated that Mary Jane Cassidy was the d/o James and Flora Cassidy.
If Mary Jane was a d/o James Cassidy there were:
James Cassidy b. ca. 1810, d. Saint John Co., NB 23OCT1872 age 62 years. His funeral was from the home of W. J. Cassidy, Union St. He was b. Ennisstymon, County Clare, Ireland. He had been in NB since ca. 1834. William J. Cassidy (ca. 1846-3MAR1886) was his cousin. William is likely William Cassedy b. Ireland ca. 1847 in Dukes Ward, Saint John in 1871, with a wife, Maggie (ca. 1851) and mother, Annie (ca. 1801.)
This may have been James Cassidy b. Ireland ca. 1815, living in Kings Ward, Saint John in 1871. He apparently lived alone, was a trader and his marital status is not given. I think, however, this was another James. I cannot find another James who even comes close in NB in 1871.
According to the 1880 census of Pecatonica, Winnebago Co., Illinois, Mary J. Foster was b. NB ca. 1834. Her father was b. Ireland and her mother was b. Scotland. This, again, excludes the Mary in Fredericton in 1851. It also suggests that her parents may have been married in NB.