[Fix] Refactor project
This commit is contained in:
@@ -7,12 +7,12 @@ namespace YachtDice.Tests
|
||||
{
|
||||
public sealed class DiceCollectionTests
|
||||
{
|
||||
private DiceCollection collection;
|
||||
private DiceCollection _collection;
|
||||
|
||||
[SetUp]
|
||||
public void SetUp()
|
||||
{
|
||||
collection = new DiceCollection();
|
||||
_collection = new DiceCollection();
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -20,9 +20,9 @@ namespace YachtDice.Tests
|
||||
{
|
||||
var die = StandardDice.CreateStandardD6ForTest();
|
||||
|
||||
collection.Add(die);
|
||||
_collection.Add(die);
|
||||
|
||||
Assert.AreEqual(1, collection.OwnedDice.Count);
|
||||
Assert.AreEqual(1, _collection.OwnedDice.Count);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -30,18 +30,18 @@ namespace YachtDice.Tests
|
||||
{
|
||||
var die = StandardDice.CreateStandardD6ForTest();
|
||||
|
||||
collection.Add(die);
|
||||
collection.Add(die);
|
||||
_collection.Add(die);
|
||||
_collection.Add(die);
|
||||
|
||||
Assert.AreEqual(1, collection.OwnedDice.Count);
|
||||
Assert.AreEqual(1, _collection.OwnedDice.Count);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Add_Null_Ignored()
|
||||
{
|
||||
collection.Add(null);
|
||||
_collection.Add(null);
|
||||
|
||||
Assert.AreEqual(0, collection.OwnedDice.Count);
|
||||
Assert.AreEqual(0, _collection.OwnedDice.Count);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -49,15 +49,15 @@ namespace YachtDice.Tests
|
||||
{
|
||||
var die = StandardDice.CreateStandardD6ForTest();
|
||||
|
||||
collection.Add(die);
|
||||
_collection.Add(die);
|
||||
|
||||
Assert.IsTrue(collection.OwnsById("standard_d6"));
|
||||
Assert.IsTrue(_collection.OwnsById("standard_d6"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void OwnsById_ReturnsFalseWhenNotOwned()
|
||||
{
|
||||
Assert.IsFalse(collection.OwnsById("standard_d6"));
|
||||
Assert.IsFalse(_collection.OwnsById("standard_d6"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -65,10 +65,10 @@ namespace YachtDice.Tests
|
||||
{
|
||||
var die = StandardDice.CreateStandardD6ForTest();
|
||||
|
||||
collection.Add(die);
|
||||
collection.Remove(die);
|
||||
_collection.Add(die);
|
||||
_collection.Remove(die);
|
||||
|
||||
Assert.AreEqual(0, collection.OwnedDice.Count);
|
||||
Assert.AreEqual(0, _collection.OwnedDice.Count);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -76,9 +76,9 @@ namespace YachtDice.Tests
|
||||
{
|
||||
var die = StandardDice.CreateStandardD6ForTest();
|
||||
|
||||
collection.Add(die);
|
||||
_collection.Add(die);
|
||||
|
||||
var ids = collection.GetSaveData();
|
||||
var ids = _collection.GetSaveData();
|
||||
Assert.AreEqual(1, ids.Count);
|
||||
Assert.AreEqual("standard_d6", ids[0]);
|
||||
}
|
||||
@@ -90,10 +90,10 @@ namespace YachtDice.Tests
|
||||
var catalog = DiceCatalog.CreateForTest(new List<DiceDefinition> { die });
|
||||
var ids = new List<string> { "standard_d6" };
|
||||
|
||||
collection.LoadSaveData(ids, catalog);
|
||||
_collection.LoadSaveData(ids, catalog);
|
||||
|
||||
Assert.AreEqual(1, collection.OwnedDice.Count);
|
||||
Assert.AreEqual("standard_d6", collection.OwnedDice[0].Id);
|
||||
Assert.AreEqual(1, _collection.OwnedDice.Count);
|
||||
Assert.AreEqual("standard_d6", _collection.OwnedDice[0].Id);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -102,9 +102,9 @@ namespace YachtDice.Tests
|
||||
var catalog = DiceCatalog.CreateForTest(new List<DiceDefinition>());
|
||||
var ids = new List<string> { "nonexistent" };
|
||||
|
||||
collection.LoadSaveData(ids, catalog);
|
||||
_collection.LoadSaveData(ids, catalog);
|
||||
|
||||
Assert.AreEqual(0, collection.OwnedDice.Count);
|
||||
Assert.AreEqual(0, _collection.OwnedDice.Count);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -112,20 +112,20 @@ namespace YachtDice.Tests
|
||||
{
|
||||
var die = StandardDice.CreateStandardD6ForTest();
|
||||
|
||||
collection.Add(die);
|
||||
collection.Clear();
|
||||
_collection.Add(die);
|
||||
_collection.Clear();
|
||||
|
||||
Assert.AreEqual(0, collection.OwnedDice.Count);
|
||||
Assert.AreEqual(0, _collection.OwnedDice.Count);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Add_FiresOnChanged()
|
||||
{
|
||||
bool fired = false;
|
||||
collection.OnChanged += () => fired = true;
|
||||
_collection.OnChanged += () => fired = true;
|
||||
|
||||
var die = StandardDice.CreateStandardD6ForTest();
|
||||
collection.Add(die);
|
||||
_collection.Add(die);
|
||||
|
||||
Assert.IsTrue(fired);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user