-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathInventoryPartSkippedCountsTests.cs
More file actions
43 lines (36 loc) · 1.26 KB
/
InventoryPartSkippedCountsTests.cs
File metadata and controls
43 lines (36 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using ByteSync.Models.Inventories;
using FluentAssertions;
using NUnit.Framework;
namespace ByteSync.Client.UnitTests.Models.Inventories;
[TestFixture]
public class InventoryPartSkippedCountsTests
{
[Test]
public void RecordSkippedEntry_ShouldUpdateTotalAndReasonCounts()
{
// Arrange
var part = new InventoryPart();
// Act
part.RecordSkippedEntry(SkipReason.Hidden);
part.RecordSkippedEntry(SkipReason.Hidden);
part.RecordSkippedEntry(SkipReason.NoiseEntry);
// Assert
part.SkippedCount.Should().Be(3);
part.GetSkippedCountByReason(SkipReason.Hidden).Should().Be(2);
part.GetSkippedCountByReason(SkipReason.NoiseEntry).Should().Be(1);
part.GetSkippedCountByReason(SkipReason.Offline).Should().Be(0);
}
[Test]
public void SkippedCountsByReason_WhenSetToNull_ShouldFallbackToEmptyDictionary()
{
// Arrange
var part = new InventoryPart();
part.SkippedCountsByReason = null!;
// Act
var skippedCount = part.SkippedCount;
var hiddenCount = part.GetSkippedCountByReason(SkipReason.Hidden);
// Assert
skippedCount.Should().Be(0);
hiddenCount.Should().Be(0);
}
}