public void WhenProjectIsNotLoadedWillNotSerialize() { var spyIXmlSerializer = new SpyIXmlSerializer(); SetupClass(xmlSerializer: spyIXmlSerializer).Serialize(new List<IItem>()); Assert.IsFalse(spyIXmlSerializer.SerializeHasBeenCalled); }
public void WhenProjectIsLoadedWillSerialize() { var project = new StubIProject { PathGet = () => @"C:\\" }; var projectLoader = new StubIProjectLoader { CurrentProjectGet = () => project }; var spyIXmlSerializer = new SpyIXmlSerializer(); SetupClass(projectLoader: projectLoader, xmlSerializer: spyIXmlSerializer).Serialize(new List<IItem>()); Assert.IsTrue(spyIXmlSerializer.SerializeHasBeenCalled); }