Skip to content

Commit b552d45

Browse files
Merge pull request #554 from NeoCoderMatrix86/546-remove-sections
Remove sections
2 parents 34816ef + 97cdd8b commit b552d45

33 files changed

Lines changed: 275 additions & 1543 deletions

AudioCuesheetEditor.End2EndTests/Tests/Desktop/BasicTest.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ public async Task ChangeLanguage_ShouldSwitchLanguage_WhenGermanIsSelected()
6868
var detailView = new DetailView(TestPage);
6969
await detailView.GotoAsync();
7070
await bar.ChangeLanguageAsync("German (Germany)");
71-
await Expect(TestPage.GetByRole(AriaRole.Heading, new() { Name = "Abschnitte" })).ToBeVisibleAsync();
7271
await Expect(TestPage.GetByRole(AriaRole.Heading, new() { Name = "Allgemeine Informationen" })).ToBeVisibleAsync();
7372
await Expect(TestPage.GetByText("Aufnahmeansicht")).ToBeVisibleAsync();
7473
await Expect(TestPage.GetByRole(AriaRole.Heading, new() { Name = "Titel" })).ToBeVisibleAsync();
@@ -79,7 +78,7 @@ public async Task ChangeLanguage_ShouldSwitchLanguage_WhenGermanIsSelected()
7978
await Expect(TestPage.Locator("#app")).ToMatchAriaSnapshotAsync("- paragraph: Künstler\n- paragraph: Titel\n- paragraph: Audiodatei\n- paragraph: CDTextdatei\n- paragraph: Katalognummer\n- paragraph: Datum\n- paragraph: Datum & Uhrzeit\n- paragraph: Uhrzeit");
8079
await TestPage.GetByText("CDTextdatei").ClickAsync();
8180
await exportDialog.OpenSchemeMenuAsync("Schema Titel");
82-
await Expect(TestPage.Locator("#app")).ToMatchAriaSnapshotAsync("- paragraph: Position\n- paragraph: Künstler\n- paragraph: Titel\n- paragraph: Beginn\n- paragraph: Ende\n- paragraph: Länge\n- paragraph: Markierungen\n- paragraph: Vorlücke\n- paragraph: Nachlücke");
81+
await Expect(TestPage.GetByTestId("menu-wrapper")).ToMatchAriaSnapshotAsync("- paragraph: Position\n- paragraph: Künstler\n- paragraph: Titel\n- paragraph: Begin\n- paragraph: End\n- paragraph: Länge\n- paragraph: Markierungen\n- paragraph: Vorlücke\n- paragraph: Nachlücke");
8382
}
8483

8584
[TestMethod]

AudioCuesheetEditor.End2EndTests/Tests/Desktop/ExportTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public async Task DownloadProject_GeneratesProjectFile_WhenCuesheetIsValidAsync(
6868
using var stream = await download.CreateReadStreamAsync();
6969
using var reader = new StreamReader(stream);
7070
var content = await reader.ReadToEndAsync(TestContext.CancellationToken);
71-
Assert.AreEqual("{\"Tracks\":[{\"Position\":1,\"Artist\":\"Track Artist 1\",\"Title\":\"Track Title 1\",\"Begin\":\"00:00:00\",\"End\":\"00:05:48\",\"Flags\":[],\"IsLinkedToPreviousTrack\":true}],\"Artist\":\"Cuesheet Artist 1\",\"Title\":\"Cuesheet Title 1\",\"Audiofile\":{\"Name\":\"Kalimba.mp3\",\"Duration\":\"00:05:48\",\"AudioCodec\":{\"MimeType\":\"audio/mpeg\",\"FileExtension\":\".mp3\",\"Name\":\"AudioCodec MP3\"}},\"Sections\":[]}", content);
71+
Assert.AreEqual("{\"Tracks\":[{\"Position\":1,\"Artist\":\"Track Artist 1\",\"Title\":\"Track Title 1\",\"Begin\":\"00:00:00\",\"End\":\"00:05:48\",\"Flags\":[],\"IsLinkedToPreviousTrack\":true}],\"Artist\":\"Cuesheet Artist 1\",\"Title\":\"Cuesheet Title 1\",\"Audiofile\":{\"Name\":\"Kalimba.mp3\",\"Duration\":\"00:05:48\",\"AudioCodec\":{\"MimeType\":\"audio/mpeg\",\"FileExtension\":\".mp3\",\"Name\":\"AudioCodec MP3\"}}}", content);
7272
}
7373

7474
[TestMethod]

AudioCuesheetEditor.End2EndTests/Tests/Smartphone/BasicTestSmartphone.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ public async Task ChangeLanguage_ShouldSwitchLanguage_WhenGermanIsSelected()
7070
var detailView = new DetailView(TestPage);
7171
await detailView.GotoAsync();
7272
await bar.ChangeLanguageAsync("German (Germany)");
73-
await Expect(TestPage.GetByRole(AriaRole.Heading, new() { Name = "Abschnitte" })).ToBeVisibleAsync();
7473
await Expect(TestPage.GetByRole(AriaRole.Heading, new() { Name = "Allgemeine Informationen" })).ToBeVisibleAsync();
7574
await Expect(TestPage.GetByText("Aufnahmeansicht")).ToBeVisibleAsync();
7675
await Expect(TestPage.GetByRole(AriaRole.Heading, new() { Name = "Titel" })).ToBeVisibleAsync();
@@ -81,7 +80,7 @@ public async Task ChangeLanguage_ShouldSwitchLanguage_WhenGermanIsSelected()
8180
await Expect(TestPage.Locator("#app")).ToMatchAriaSnapshotAsync("- paragraph: Künstler\n- paragraph: Titel\n- paragraph: Audiodatei\n- paragraph: CDTextdatei\n- paragraph: Katalognummer\n- paragraph: Datum\n- paragraph: Datum & Uhrzeit\n- paragraph: Uhrzeit");
8281
await TestPage.GetByText("CDTextdatei").ClickAsync();
8382
await exportDialog.OpenSchemeMenuAsync("Schema Titel");
84-
await Expect(TestPage.Locator("#app")).ToMatchAriaSnapshotAsync("- paragraph: Position\n- paragraph: Künstler\n- paragraph: Titel\n- paragraph: Beginn\n- paragraph: Ende\n- paragraph: Länge\n- paragraph: Markierungen\n- paragraph: Vorlücke\n- paragraph: Nachlücke");
83+
await Expect(TestPage.GetByTestId("menu-wrapper")).ToMatchAriaSnapshotAsync("- paragraph: Position\n- paragraph: Künstler\n- paragraph: Titel\n- paragraph: Begin\n- paragraph: End\n- paragraph: Länge\n- paragraph: Markierungen\n- paragraph: Vorlücke\n- paragraph: Nachlücke");
8584
}
8685

8786
[TestMethod]

AudioCuesheetEditor.End2EndTests/Tests/Smartphone/ExportTestSmartphone.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public async Task DownloadProject_GeneratesProjectFile_WhenCuesheetIsValidAsync(
6868
using var stream = await download.CreateReadStreamAsync();
6969
using var reader = new StreamReader(stream);
7070
var content = await reader.ReadToEndAsync(TestContext.CancellationToken);
71-
Assert.AreEqual("{\"Tracks\":[{\"Position\":1,\"Artist\":\"Track Artist 1\",\"Title\":\"Track Title 1\",\"Begin\":\"00:00:00\",\"End\":\"00:05:48\",\"Flags\":[],\"IsLinkedToPreviousTrack\":true}],\"Artist\":\"Cuesheet Artist 1\",\"Title\":\"Cuesheet Title 1\",\"Audiofile\":{\"Name\":\"Kalimba.mp3\",\"Duration\":\"00:05:48\",\"AudioCodec\":{\"MimeType\":\"audio/mpeg\",\"FileExtension\":\".mp3\",\"Name\":\"AudioCodec MP3\"}},\"Sections\":[]}", content);
71+
Assert.AreEqual("{\"Tracks\":[{\"Position\":1,\"Artist\":\"Track Artist 1\",\"Title\":\"Track Title 1\",\"Begin\":\"00:00:00\",\"End\":\"00:05:48\",\"Flags\":[],\"IsLinkedToPreviousTrack\":true}],\"Artist\":\"Cuesheet Artist 1\",\"Title\":\"Cuesheet Title 1\",\"Audiofile\":{\"Name\":\"Kalimba.mp3\",\"Duration\":\"00:05:48\",\"AudioCodec\":{\"MimeType\":\"audio/mpeg\",\"FileExtension\":\".mp3\",\"Name\":\"AudioCodec MP3\"}}}", content);
7272
}
7373

7474
[TestMethod]

AudioCuesheetEditor.Tests/Model/AudioCuesheet/CuesheetTests.cs

Lines changed: 0 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
using AudioCuesheetEditor.Model.AudioCuesheet;
1717
using AudioCuesheetEditor.Model.Entity;
1818
using AudioCuesheetEditor.Model.IO.Audio;
19-
using AudioCuesheetEditor.Model.IO.Export;
2019
using AudioCuesheetEditor.Tests.Utility;
2120
using Microsoft.VisualStudio.TestTools.UnitTesting;
2221
using Moq;
@@ -414,96 +413,6 @@ public void IsRecordingPossible_WhenNoErrors_ReturnsEmpty()
414413
Assert.IsEmpty(errors);
415414
}
416415

417-
[TestMethod]
418-
public void AddSection_WithValidData_FiresEvents()
419-
{
420-
// Arrange
421-
var cuesheet = new Cuesheet();
422-
bool eventFired = false;
423-
cuesheet.TraceablePropertyChanged += (sender, args) =>
424-
{
425-
if (args.TraceableChange.PropertyName == nameof(Cuesheet.Sections))
426-
{
427-
eventFired = true;
428-
}
429-
};
430-
431-
// Act
432-
var section = cuesheet.AddSection();
433-
434-
// Assert
435-
Assert.IsTrue(eventFired);
436-
Assert.IsNotNull(section);
437-
Assert.HasCount(1, cuesheet.Sections);
438-
Assert.AreEqual(cuesheet, section.Cuesheet);
439-
}
440-
441-
[TestMethod()]
442-
public void RemoveSections_RemovesSpecifiedSections()
443-
{
444-
// Arrange
445-
var cuesheet = new Cuesheet();
446-
var section1 = cuesheet.AddSection();
447-
var section2 = cuesheet.AddSection();
448-
var section3 = cuesheet.AddSection();
449-
var sectionsToRemove = new List<CuesheetSection> { section1, section3 };
450-
bool eventFired = false;
451-
cuesheet.TraceablePropertyChanged += (sender, args) =>
452-
{
453-
if (args.TraceableChange.PropertyName == nameof(Cuesheet.Sections))
454-
{
455-
eventFired = true;
456-
}
457-
};
458-
459-
// Act
460-
cuesheet.RemoveSections(sectionsToRemove);
461-
462-
// Assert
463-
Assert.IsTrue(eventFired);
464-
Assert.HasCount(1, cuesheet.Sections);
465-
Assert.IsTrue(cuesheet.Sections.Contains(section2));
466-
Assert.IsFalse(cuesheet.Sections.Contains(section1));
467-
Assert.IsFalse(cuesheet.Sections.Contains(section3));
468-
}
469-
470-
[TestMethod()]
471-
public void GetSection_ReturnsCorrectSection()
472-
{
473-
// Arrange
474-
var cuesheet = new Cuesheet();
475-
var section1 = cuesheet.AddSection();
476-
section1.Begin = TimeSpan.Zero;
477-
section1.End = TimeSpan.FromSeconds(120);
478-
cuesheet.AddSection();
479-
var track = new Track { Begin = TimeSpan.Zero, End = TimeSpan.FromSeconds(83) };
480-
cuesheet.AddTrack(track);
481-
482-
// Act
483-
var result = cuesheet.GetSection(track);
484-
485-
// Assert
486-
Assert.AreEqual(section1, result);
487-
}
488-
489-
[TestMethod()]
490-
public void GetSection_ReturnsNullIfNoMatchingSection()
491-
{
492-
// Arrange
493-
var cuesheet = new Cuesheet();
494-
var section1 = cuesheet.AddSection();
495-
section1.Begin = TimeSpan.Zero;
496-
section1.End = TimeSpan.FromHours(1.5);
497-
var track = new Track { Begin = section1.End + TimeSpan.FromSeconds(1), End = section1.End + TimeSpan.FromSeconds(2) };
498-
cuesheet.AddTrack(track);
499-
500-
// Act
501-
var result = cuesheet.GetSection(track);
502-
503-
// Assert
504-
Assert.IsNull(result);
505-
}
506-
507416
[TestMethod]
508417
public void MoveTracksPossible_ShouldReturnFalse_WhenNoTracksToMove()
509418
{

AudioCuesheetEditor.Tests/Model/IO/Export/CuesheetSectionTests.cs

Lines changed: 0 additions & 175 deletions
This file was deleted.

0 commit comments

Comments
 (0)