public AssetListElementVM(FileSystemAsset fileSystemAsset, Action <FileSystemAsset> onAssetChosen) { m_FileSystemAsset = fileSystemAsset; m_OnAssetChosen = onAssetChosen; IsFolder = m_FileSystemAsset is FolderAsset; }
public void Should_Throw_Exception_If_Asset_Does_Not_Exist_On_Disk() { string source = "~/image.png"; var file = new FileSystemFile("../../Files/Images/does-not-exist.png"); var asset = new FileSystemAsset(file); Assert.Throws<Exception>(() => factory.Create(asset)); }
private void OnAssetChosen(FileSystemAsset asset) { if (asset is FolderAsset folderAsset) { SetFolder(folderAsset); } else if (asset is LessonAsset lessonAsset) { LessonAccess.Instance.RequestStartLesson(lessonAsset); } }
public void Should_Create_Bundle_From_Asset() { string source = "~/image.png"; var file = new FileSystemFile("../../Files/Images/ImageBundleFactoryTests.png"); var asset = new FileSystemAsset(file); ImageBundle returnBundle = factory.Create(asset); Assert.AreEqual(1, returnBundle.Assets.Count); Assert.AreEqual("093e4bfea387f8f7f7948f0853b29f1d-ImageBundleFactoryTests-png", returnBundle.Name); Assert.AreEqual("image/png", returnBundle.ContentType); Assert.AreEqual(187, returnBundle.Height); Assert.AreEqual(196, returnBundle.Width); }