Exemplo n.º 1
0
        public UnitTestChampionship()
        {
            MoviesCupApiContext.UrlMoviesSource = "https://copadosfilmes.azurewebsites.net/api/filmes";
            var context = DbContextFactory <MoviesCupApiContext> .Memory();

            _moviesController       = new MoviesController(context);
            _championshipController = new ChampionshipController(context);
        }
Exemplo n.º 2
0
        public static void Main()
        {
            IChampionshipController controller = new ChampionshipController();
            IReader reader = new ConsoleReader();
            IWriter writer = new ConsoleWriter();

            Engine enigne = new Engine(controller, reader, writer);

            enigne.Run();
        }
Exemplo n.º 3
0
        public void Post_ShouldReturnOK()
        {
            var championshipController = new ChampionshipController(new ChampionshipService());

            var result = championshipController.Post(movies);

            var okResult = result as OkObjectResult;

            okResult.StatusCode.Should().Be(200);
        }
Exemplo n.º 4
0
    public static void Main()
    {
        var reader = new ConsoleReader();
        var writer = new ConsoleWriter();

        var controller = new ChampionshipController();

        IEngine engine = new Engine(reader, writer, controller);

        engine.Run();
    }
Exemplo n.º 5
0
        public static void Main()
        {
            IChampionshipController controller = new ChampionshipController();
            IReader reader = new ConsoleReader();
            IWriter writer = new ConsoleWriter();

            Engine enigne = new Engine(controller, reader, writer);

            enigne.Run();

            //System.Console.WriteLine(writer.ToString());
        }
Exemplo n.º 6
0
        public void Post_ShouldReturnBadRequest()
        {
            var championshipController = new ChampionshipController(new ChampionshipService());

            var emptyMovies = new List <Movie>();

            var result = championshipController.Post(emptyMovies);

            var badRequestResult = result as ObjectResult;

            badRequestResult.StatusCode.Should().Be(400);
        }
Exemplo n.º 7
0
        public static void Main()
        {
            IChampionshipController controller = new ChampionshipController();
            IReader reader = new ConsoleReader();
            //IWriter writer = new ConsoleWriter();

            //За по-лесно и по-четимо локално нестване на изходните данни си правим StringBuilderWriter().
            //За judge този ред се трие, а горният се откоментира
            IWriter writer = new StringBuilderWriter();

            Engine enigne = new Engine(controller, reader, writer);

            enigne.Run();

            //За локално нестване. При изпращане в judgе, тези редове се изтриват.
            Console.Clear();
            Console.WriteLine(writer);
        }
        public static void Main()
        {
            //string filePath = Path.Combine("..", "..", "..", "result.txt");   // When using FileWriter as writer
            //File.Create(filePath).Close();

            IChampionshipController controller = new ChampionshipController();

            IReader reader = new ConsoleReader();

            //IWriter writer = new FileWriter();   // wWhen using FileWriter as writer

            IWriter sbWriter = new SBWriter();   // When using StringBuilder as writer

            IEngine enigne = new Engine(controller, reader, sbWriter);

            enigne.Run();


            Console.Clear();
            Console.WriteLine(sbWriter);  // When using StringBuilder as writer
        }
Exemplo n.º 9
0
 public ChampionshipControllerTest()
 {
     _mockService = new Mock <IChampionshipService>();
     _controller  = new ChampionshipController(_mockService.Object);
 }
 public ChampionshipControllerTest()
 {
     championshipController = CreateNewInstanceChampionshipController();
 }
 public void Before()
 {
     _championshipService    = new Mock <IChampionshipService>();
     _championshipController = new ChampionshipController(_championshipService.Object);
 }
Exemplo n.º 12
0
 public CommandInterpreter(ChampionshipController controller)
 {
     this.controller = controller;
 }