예제 #1
0
 public void TestAddTheatre_ShouldThrowDuplicateTheatreException()
 {
     Engine engine = new Engine();
     const string TheatreName = "Some theatre";
     engine.AddTheatre(TheatreName);
     engine.AddTheatre(TheatreName);
 }
예제 #2
0
 public void TestAddPerformance_ShouldAddOnePerformance()
 {
     Engine engine = new Engine();
     engine.AddTheatre("testTheatre");
     engine.AddPerformance("testTheatre", "perform", DateTime.Now, new TimeSpan(1, 3, 1), 1m);
     Assert.AreEqual(1, engine.ListAllPerformances().Count());
 }
예제 #3
0
 public void TestAddPerformance_ShouldThrowTimeDurationOverlapException()
 {
     Engine engine = new Engine();
     engine.AddTheatre("testTheatre");
     engine.AddPerformance("testTheatre", "perform", new DateTime(2000, 11, 11, 12, 12, 12), new TimeSpan(1, 3, 1), 1m);
     engine.AddPerformance("testTheatre", "perform", new DateTime(2000, 11, 11, 11, 55, 12), new TimeSpan(1, 3, 1), 1m);
 }
예제 #4
0
 public void TestListPerformances_ShouldHaveZeroElements()
 {
     Engine engine = new Engine();
     const string TheatreName = "Some theatre";
     engine.AddTheatre(TheatreName);
     var performances = engine.ListPerformances(TheatreName);
     Assert.AreEqual(0, performances.Count());
 }
        protected static void Main()
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;

            var theatreEngine = new Engine();

            theatreEngine.Run();
        }
예제 #6
0
        public void TestAddPerformance_ShouldAddManyPerformance()
        {
            Engine engine = new Engine();
            engine.AddTheatre("testTheatre");
            for (int i = 0; i < 10; i++)
            {
                engine.AddPerformance("testTheatre", "perform" + i, new DateTime(2000, 11, i + 1), new TimeSpan(1, 3, 1), 1m);
            }

            Assert.AreEqual(10, engine.ListAllPerformances().Count());
        }
예제 #7
0
        public void TestListTheatres_ShouldHaveManyElements()
        {
            int testElementsToAdd = 20;
            Engine engine = new Engine();
            var theatres = engine.ListTheatres();
            for (int i = 0; i < testElementsToAdd; i++)
            {
                string name = "Theatr" + i;
                engine.AddTheatre(name);
            }

            Assert.AreEqual(testElementsToAdd, theatres.Count());
        }
예제 #8
0
 public void TestListPerformances_ShouldThrowTheatreNotFoundException()
 {
     Engine engine = new Engine();
     const string TheatreName = "Some theatre";
     engine.ListPerformances(TheatreName);
 }
예제 #9
0
 public void TestEmptyListTheatres_ShouldHaveZeroElements()
 {
     Engine engine = new Engine();
     int elementCount = engine.ListTheatres().Count();
     Assert.AreEqual(0, elementCount);
 }
예제 #10
0
 public void TestAddPerformance_ShouldThrowTheatreNotFoundException()
 {
     Engine engine = new Engine();
     engine.AddPerformance("testTheatre", "perform", DateTime.Now, new TimeSpan(1, 3, 1), 1m);
 }
예제 #11
0
        public void TestListTheatres_ShouldHaveOneElements()
        {
            Engine engine = new Engine();
            var theatres = engine.ListTheatres();
            engine.AddTheatre("test");

            Assert.AreEqual(1, theatres.Count());
        }
예제 #12
0
 public void InitTheater()
 {
     this.applicationEngine = new Engine();
 }