public void VersionStoreAndLoad_StoresDisplayTypes() { string fn = uth.NewTemporaryFileName(true); var sut = new JsonVersionPersister(fn); var cv = new CompleteVersion(new VersionUnit("1", "", DigitIncremementBehaviour.ContinualIncrement), new VersionUnit("1", ".", DigitIncremementBehaviour.ContinualIncrement), new VersionUnit("1", ".", DigitIncremementBehaviour.ContinualIncrement), new VersionUnit("1", ".", DigitIncremementBehaviour.ContinualIncrement)); // None of the defaults are no display, therefore this should set all to a new value cv.SetDisplayTypeForVersion(FileUpdateType.NetAssembly, DisplayType.NoDisplay); cv.SetDisplayTypeForVersion(FileUpdateType.NetFile, DisplayType.NoDisplay); cv.SetDisplayTypeForVersion(FileUpdateType.NetInformational, DisplayType.NoDisplay); cv.SetDisplayTypeForVersion(FileUpdateType.Wix, DisplayType.NoDisplay); cv.SetDisplayTypeForVersion(FileUpdateType.StdAssembly, DisplayType.NoDisplay); cv.SetDisplayTypeForVersion(FileUpdateType.StdFile, DisplayType.NoDisplay); cv.SetDisplayTypeForVersion(FileUpdateType.StdInformational, DisplayType.NoDisplay); cv.SetDisplayTypeForVersion(FileUpdateType.Nuspec, DisplayType.NoDisplay); sut.Persist(cv); var cv2 = sut.GetVersion(); // Check that all of the display types come back as epxected Assert.Equal(DisplayType.NoDisplay, cv2.GetDisplayType(FileUpdateType.NetAssembly)); Assert.Equal(DisplayType.NoDisplay, cv2.GetDisplayType(FileUpdateType.NetFile)); Assert.Equal(DisplayType.NoDisplay, cv2.GetDisplayType(FileUpdateType.NetInformational)); Assert.Equal(DisplayType.NoDisplay, cv2.GetDisplayType(FileUpdateType.Wix)); Assert.Equal(DisplayType.NoDisplay, cv2.GetDisplayType(FileUpdateType.StdAssembly)); Assert.Equal(DisplayType.NoDisplay, cv2.GetDisplayType(FileUpdateType.StdFile)); Assert.Equal(DisplayType.NoDisplay, cv2.GetDisplayType(FileUpdateType.StdInformational)); Assert.Equal(DisplayType.NoDisplay, cv2.GetDisplayType(FileUpdateType.Nuspec)); }
public void VersionStoreAndLoad_StoresDisplayTypes() { string fn = uth.NewTemporaryFileName(true); var sut = new JsonVersionPersister(fn); var cv = new CompleteVersion(new VersionUnit("1", "", VersionIncrementBehaviour.ContinualIncrement), new VersionUnit("1", ".", VersionIncrementBehaviour.ContinualIncrement), new VersionUnit("1", ".", VersionIncrementBehaviour.ContinualIncrement), new VersionUnit("1", ".", VersionIncrementBehaviour.ContinualIncrement)); // None of the defaults are no display, therefore this should set all to a new value cv.SetDisplayTypeForVersion(FileUpdateType.Assembly4, DisplayType.NoDisplay); cv.SetDisplayTypeForVersion(FileUpdateType.AssemblyFile, DisplayType.NoDisplay); cv.SetDisplayTypeForVersion(FileUpdateType.AssemblyInformational, DisplayType.NoDisplay); cv.SetDisplayTypeForVersion(FileUpdateType.Wix, DisplayType.NoDisplay); sut.Persist(cv); var cv2 = sut.GetVersion(); Assert.Equal(DisplayType.NoDisplay, cv2.GetDisplayType(FileUpdateType.Assembly4)); //, "The file update type assembly was not returned correctly"); Assert.Equal(DisplayType.NoDisplay, cv2.GetDisplayType(FileUpdateType.AssemblyFile)); //, "The file update type AssemblyFile was not returned correctly"); Assert.Equal(DisplayType.NoDisplay, cv2.GetDisplayType(FileUpdateType.AssemblyInformational)); //, "The file update type AssemblyInformational was not returned correctly"); Assert.Equal(DisplayType.NoDisplay, cv2.GetDisplayType(FileUpdateType.Wix)); //, "The file update type assembly was not returned correctly"); }