예제 #1
0
        public void Inventor_Delegate_Succeeds()
        {
            var inventor = new Inventor(new ExpensesStrategy(), new ImprovementStrategy(), new RentStrategy());

            inventor.MakeSound();

            Assert.NotNull(inventor.CalculateExpenses(DateTime.MinValue, DateTime.MaxValue));
            Assert.NotNull(inventor.RentCost(DateTime.MinValue, DateTime.MaxValue));
            Assert.NotNull(inventor.ImprovementCost(inventor.Quality));
        }
예제 #2
0
        public void Inventor_Delegate_Fails()
        {
            var inventor = new Inventor();

            inventor.MakeSound();

            Assert.Null(inventor.CalculateExpenses(DateTime.MinValue, DateTime.MaxValue));
            Assert.Null(inventor.RentCost(DateTime.MinValue, DateTime.MaxValue));
            Assert.Null(inventor.ImprovementCost(inventor.Quality));
        }