public void TestEquals() { var seasonFalse = new Season(1, 2, 3); var seasonTrue = new Season(15, 15, 15); Assert.IsTrue(seasonTrue.Equals(_testSeason)); Assert.IsTrue(_testSeason.Equals(seasonTrue)); Assert.IsFalse(_testSeason.Equals(seasonFalse)); Assert.IsFalse(seasonFalse.Equals(_testSeason)); }
/// <summary> /// Returns true if ClanWarLeagueGroup instances are equal /// </summary> /// <param name="input">Instance of ClanWarLeagueGroup to be compared</param> /// <returns>Boolean</returns> public bool Equals(ClanWarLeagueGroup?input) { if (input == null) { return(false); } return (( Tag == input.Tag || (Tag != null && Tag.Equals(input.Tag)) ) && ( State == input.State || State.Equals(input.State) ) && ( Season == input.Season || (Season != null && Season.Equals(input.Season)) ) && ( Clans == input.Clans || Clans != null && input.Clans != null && Clans.SequenceEqual(input.Clans) ) && ( Rounds == input.Rounds || Rounds != null && input.Rounds != null && Rounds.SequenceEqual(input.Rounds) )); }
public bool Equals(DestinyProgressionResetEntry input) { if (input == null) { return(false); } return (( Season == input.Season || (Season.Equals(input.Season)) ) && ( Resets == input.Resets || (Resets.Equals(input.Resets)) )); }
public void Equals_NotCopyOfObject_NotEqual() { // Arrage var firstObj = new Season(new Uri("http://1.html"), null); firstObj.EpisodeList = new List <Episode>() { new Episode("FirstObj", new Uri("http://FirstObj.ru"), 1, 3) }; var secondObj = new Season(new Uri("http://2.html"), null); secondObj.EpisodeList = new List <Episode>() { new Episode("FirstObj", new Uri("http://FirstObj.ru"), 1, 3), new Episode("SecondObj", new Uri("http://SecondObj.ru"), 2, 4) }; // Act var result = firstObj.Equals(secondObj); // Assert Assert.IsFalse(result); }
public override bool Equals(object obj) { var other = obj as TmdbEpisodeImages; return(other != null && Id.Equals(other.Id) && Season.Equals(other.Season) && Episode.Equals(other.Episode)); }
public override void UpdateRepresentation(Season currentSeason) { base.UpdateRepresentation(currentSeason); gameObject.SetActive(currentSeason.Equals(sunflowerSeason)); }
public void EqualsTrueTest() { Season s01 = new Season(1); s01.Add(new Episode(1, "Pilot")); s01.Add(new Episode(2, "Second")); Season s02 = new Season(1); s02.Add(new Episode(1, "Pilot")); s02.Add(new Episode(2, "Second")); Assert.That(s01.Equals(s02)); }
// Update the dialog as fields are updated - gives us a highly interactive GUI. Not terribly efficient, but it works... private FieldResult updateDialog() { if (skipUpdate) { return(FieldResult.Success); } // We do a lot of GUI manipulations (sometimes just temporarily) - turn off updates SuspendLayout(); // We assume everything is perfect and sadly discover the truth. FieldResult result = FieldResult.Success; // Reset the various statuses and colors to "no error" toolStripStatusLabel.Text = String.Empty; BaseFolderTextBox.BackColor = SystemColors.Window; SeriesTextBox.BackColor = SystemColors.Window; SeasonUpDown.BackColor = SystemColors.Window; ExtrasTextBox.BackColor = SystemColors.Window; // Assume we have no folders to create (right now, everything is "perfect", remember?) NewSeriesFolderButton.Visible = false; NewSeasonFolderButton.Visible = false; NewExtrasFolderButton.Visible = false; // If this is the "Specials" season, we can't have Extras if (Season.Equals(SpecialsSeason)) { ExtrasTextBox.Text = String.Empty; ExtrasTextBox.Visible = false; } else { ExtrasTextBox.Visible = true; } // See if the base folder exists if (!folderExists(BaseFolderTextBox.Text)) { // Nope - highlight that fact BaseFolderTextBox.BackColor = Color.Red; toolStripStatusLabel.Text = "Base folder does not exist."; result = FieldResult.BadBase; } // See if the series folder exists else if (!folderExists(BaseFolderTextBox.Text, SeriesTextBox.Text)) { // Nope - but that might be because the user is modifying the base folder and isn't done yet if (!BaseFolderTextBox.Focused) { // Nope - it's because the folder as typed so far doesn't exist SeriesTextBox.BackColor = Color.Red; if (SeriesTextBox.Text.Length > 0) { NewSeriesFolderButton.Visible = true; } } result = FieldResult.BadSeries; } // See if the season folder exists else if (!folderExists(BaseFolderTextBox.Text, SeriesTextBox.Text, Season)) { // Nope - the folder as typed (so far) does not exist SeasonUpDown.BackColor = Color.Red; NewSeasonFolderButton.Visible = true; result = FieldResult.BadSeason; } // See if the (optional) extras folder exists else if (!folderExists(BaseFolderTextBox.Text, SeriesTextBox.Text, Season, ExtrasTextBox.Text)) { // Nope - the folder as typed (so far) does not exist ExtrasTextBox.BackColor = Color.Red; if (ExtrasTextBox.Text.Length > 0) { NewExtrasFolderButton.Visible = true; } result = FieldResult.BadExtras; } // If everything passed, we have a valid folder if (result == FieldResult.Success) { // If we have a valid folder, we can create a file SaveButton.Enabled = true; // If we have a media extension, we have enough info to create its name if (MediaExtensionTextBox.Text.Length > 0) { MediaFilenameCopyButton.Enabled = true; } string seasonEpisode = String.Format("S{0:00}E{1:00}", SeasonUpDown.Value, EpisodeUpDown.Value); string newFolder = buildFolderName(BaseFolderTextBox.Text, SeriesTextBox.Text, Season, ExtrasTextBox.Text); // If we've changed folders, we need to reload the folder and regenerate the NFO/Media filenames if (!newFolder.Equals(watcher.Path)) { watcher.Path = newFolder; loadList(); } // We need to update the filenames NFOFilename.Text = newFolder + "\\" + FilenameCleaner.cleanFilename(seasonEpisode + " - " + trimmed(TitleTextBox.Text) + ".nfo"); MediaFilename.Text = newFolder + "\\" + FilenameCleaner.cleanFilename(seasonEpisode + " - " + trimmed(TitleTextBox.Text) + "." + MediaExtensionTextBox.Text.ToLower()); } else { // We don't have a valid folder, so we can't save anything SaveButton.Enabled = false; MediaFilenameCopyButton.Enabled = false; // So, don't display any filenames NFOFilename.Text = String.Empty; MediaFilename.Text = String.Empty; // And there's no folder items to display either clearList(); } ResumeLayout(); return(result); }