using Buckets.Logic; namespace Buckets.Test { [TestClass] public class ContainerTest { [TestMethod] public void Container_NegativeCapacity_ShouldThrow() { Assert.ThrowsException(() => { Bucket container = new(-1, 0); }); } [TestMethod] public void Container_NegativeContent_ShouldThrow() { Assert.ThrowsException(() => { Bucket container = new(0, -1); }); } [TestMethod] public void Container_ContentLargerThanCapacity_ShouldThrow() { Assert.ThrowsException(() => { Bucket container = new(0, 1); }); } [TestMethod] public void Container_ValidParameters_ShouldEqual10() { Bucket container = new(20, 10); Assert.AreEqual(10, container.Content); } [TestMethod] public void Fill_ContentLargerThanCapacity_ShouldThrow() { Bucket container = new(20, 10); Assert.ThrowsException(() => { container.Fill(20); }); } [TestMethod] public void Fill_ValidParameters_ShouldEqual15() { Bucket container = new(20, 10); container.Fill(5); Assert.AreEqual(15, container.Content); } [TestMethod] public void Empty_NegativeContent_ShouldThrow() { Bucket container = new(20, 10); Assert.ThrowsException(() => { container.Empty(20); }); } [TestMethod] public void Empty_ValidParameters_ShouldEqual5() { Bucket container = new(20, 10); container.Empty(5); Assert.AreEqual(5, container.Content); } [TestMethod] public void Empty_ValidParameters_ShouldEqual0() { Bucket container = new(20, 10); container.Empty(); Assert.AreEqual(0, container.Content); } } }