Beispiel #1
0
        public void LauncherRepo_Retrieve()
        {
            Repo.Create(AngaraA5);

            // We create a copy of the launcher so we have something to compare against the retrieved launcher.
            // Since the serialized launcher doesn't save everything, we have to change a value that IS saved.
            var editedLauncher = AngaraA5.CopyObject();

            editedLauncher.RootIdentifier = Guid.NewGuid();

            var retrievedObject = Repo.Retrieve(AngaraA5.Name);

            // We serialized the default launcher, so if we retrieved that, its "RootIdentifier" should be the same.
            // With that said, if we retrieved the default launcher, it shouldn't be equal the edited launcher.
            Assert.IsTrue(retrievedObject.RootIdentifier == AngaraA5.RootIdentifier);
            Assert.IsTrue(retrievedObject.RootIdentifier != editedLauncher.RootIdentifier);
        }
Beispiel #2
0
        public void LauncherRepo_Update()
        {
            Repo.Create(AngaraA5);

            // We create a copy of the launcher so we have something to compare against the retrieved launcher.
            // Since the serialized launcher doesn't save everything, we have to change a value that IS saved.
            var editedLauncher = AngaraA5.CopyObject();

            editedLauncher.RootIdentifier = Guid.NewGuid();

            // Update the newly create launcher with the edited launcher.
            Repo.Update(editedLauncher);

            // Retrieve the updated launcher.
            var retievedObject = Repo.Retrieve(AngaraA5.Name);

            // We update the launcher with another one that had an edit
            // "RootIdentifier", so it shouldn't be equal the default launcher.
            Assert.IsTrue(retievedObject.RootIdentifier != AngaraA5.RootIdentifier);
        }
Beispiel #3
0
        public void LauncherRepo_CreateAlreadyExistentItem()
        {
            Repo.Create(AngaraA5);

            // We create a copy of the launcher so we have something to compare against the retrieved launcher.
            // Since the serialized launcher doesn't save everything, we have to change a value that IS saved.
            var editedLauncher = AngaraA5.CopyObject();

            editedLauncher.RootIdentifier = Guid.NewGuid();

            // Try to create another object even though one should already exist.
            Repo.Create(editedLauncher);

            var retievedObject = Repo.Retrieve(AngaraA5.Name);

            // We tried to create a launcher with the same name, but an edited "RootIdentifier". Since
            // the Create() method doesn't allow the creation of launcher directories with the same name,
            // the retrieved object's "RootIdentifier" shouldn't equal the edited launcher's identifier.
            Assert.IsTrue(retievedObject.RootIdentifier != editedLauncher.RootIdentifier);
        }