public void Test_CreateFilePath_Entity() { TestUser user = new TestUser(); user.FirstName = "First"; user.ID = Guid.NewGuid(); string basePath = TestUtilities.GetTestingPath(this) + Path.DirectorySeparatorChar + "Export"; string path = new EntityFileNamer(user, basePath).CreateFilePath(); string expected = basePath + Path.DirectorySeparatorChar + user.GetType() + Path.DirectorySeparatorChar + user.ID.ToString() + ".xml"; Assert.AreEqual(expected, path, "The path doesn't match what's expected."); }
public void Test_CreateFilePath_Reference() { TestUser user = new TestUser(); user.FirstName = "First"; user.ID = Guid.NewGuid(); TestRole role = new TestRole(); role.ID = Guid.NewGuid(); user.Roles = new TestRole[] {role}; string basePath = TestUtilities.GetTestingPath(this) + Path.DirectorySeparatorChar + "Export"; EntityReference reference = DataAccess.Data.Referencer.GetActiveReferences(user)[0]; string path = new EntityFileNamer(reference, basePath).CreateFilePath(); string expected = basePath + Path.DirectorySeparatorChar + role.ShortTypeName + "-" + user.ShortTypeName + Path.DirectorySeparatorChar + reference.ID.ToString() + ".xml"; Assert.AreEqual(expected, path, "The path doesn't match what's expected."); }