├── .gitignore ├── LICENSE ├── README.md └── Topics ├── 00. Course-intro ├── README.md ├── imgs │ ├── award.png │ ├── images.jpg │ ├── ninja.jpg │ ├── pic00.png │ ├── pic01.png │ ├── pic02.png │ ├── pic03.png │ ├── pic04.png │ ├── pic05.png │ ├── pic06.png │ ├── pic07.png │ ├── pic08.png │ ├── pic09.png │ ├── pic10.png │ ├── pic11.png │ ├── pic12.png │ ├── pic13.png │ ├── pic14.png │ ├── pic15.png │ ├── pic16.png │ ├── pic17.png │ ├── pic18.jpg │ ├── pic18.png │ ├── pic19.png │ ├── pic20.png │ ├── pic21.png │ ├── pic22.png │ ├── pic23.png │ ├── pic24.png │ ├── pic25.png │ ├── pic26.png │ ├── pic27.png │ ├── pic28.png │ ├── pic29.png │ ├── pic30.png │ ├── pic31.png │ ├── pic32.png │ ├── pic33.png │ ├── pic34.png │ ├── pic35.png │ ├── pic36.png │ ├── pic37.png │ ├── pic38.png │ ├── pic39.png │ ├── pic40.png │ ├── pic41.png │ ├── pic42.png │ ├── pic43.png │ ├── pic44.png │ ├── pic45.png │ ├── pic46.png │ ├── pic47.png │ ├── pic48.png │ ├── pic49.png │ ├── pic50.png │ ├── pic51.png │ ├── pic52.png │ └── pic53.png └── index.html ├── 00. Software engineering ├── README.md ├── imgs │ ├── pic00.png │ ├── pic02.png │ ├── pic04.png │ ├── pic06.png │ ├── pic07.png │ ├── pic08.png │ ├── pic09.png │ ├── pic10.png │ ├── pic11.png │ ├── pic12.png │ ├── pic13.png │ ├── pic16.png │ ├── pic17.png │ ├── pic19.png │ ├── pic20.png │ ├── pic21.png │ ├── pic25.png │ ├── pic26.png │ ├── pic27.png │ ├── pic28.png │ ├── pic29.png │ ├── pic30.png │ ├── pic31.png │ ├── pic32.png │ ├── pic33.png │ ├── pic35.png │ ├── pic36.png │ ├── pic37.png │ ├── pic38.png │ └── pic39.png └── index.html ├── 01. Unit Testing ├── README.md ├── demos │ ├── Live-Demos │ │ └── Validators │ │ │ ├── Validators.sln │ │ │ ├── Validators │ │ │ ├── App.config │ │ │ ├── Exceptions │ │ │ │ ├── InvalidPasswordException.cs │ │ │ │ └── InvalidUsernameException.cs │ │ │ ├── Helpers │ │ │ │ └── CharHelper.cs │ │ │ ├── PasswordValidator.cs │ │ │ ├── Program.cs │ │ │ ├── Properties │ │ │ │ └── AssemblyInfo.cs │ │ │ ├── UsernameValidator.cs │ │ │ └── Validators.csproj │ │ │ └── ValidatorsTests │ │ │ ├── PasswordValidatorTests.cs │ │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ │ ├── UsernameValidatorTests.cs │ │ │ ├── ValidatorsTests.csproj │ │ │ └── packages.config │ ├── NUnit-Demo │ │ ├── Bank │ │ │ ├── Account.cs │ │ │ ├── Bank.cs │ │ │ └── Bank.csproj │ │ ├── NUnit-Demo.sln │ │ └── TestBank │ │ │ ├── TestAccount.cs │ │ │ ├── TestBank.cs │ │ │ ├── TestBank.csproj │ │ │ └── lib │ │ │ └── nunit.framework.dll │ ├── TestingFrameworks │ │ ├── TestingFrameworks.sln │ │ ├── Utilities.Tests.MsTest │ │ │ ├── Data │ │ │ │ └── SumData.xml │ │ │ ├── MathUtilsTests.cs │ │ │ ├── Properties │ │ │ │ └── AssemblyInfo.cs │ │ │ ├── StringUtilsTests.cs │ │ │ ├── Utilities.Tests.MsTest.csproj │ │ │ ├── app.config │ │ │ └── packages.config │ │ ├── Utilities.Tests.MsTestV2 │ │ │ ├── MathUtilsTests.cs │ │ │ ├── Properties │ │ │ │ └── AssemblyInfo.cs │ │ │ ├── StringUtilsTests.cs │ │ │ ├── Utilities.Tests.MsTestV2.csproj │ │ │ └── packages.config │ │ ├── Utilities.Tests.NUnit │ │ │ ├── MathUtilsTests.cs │ │ │ ├── Properties │ │ │ │ └── AssemblyInfo.cs │ │ │ ├── StringUtilsTests.cs │ │ │ ├── Utilities.Tests.NUnit.csproj │ │ │ └── packages.config │ │ └── Utilities │ │ │ ├── MathUtils.cs │ │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ │ ├── StringUtils.cs │ │ │ └── Utilities.csproj │ └── VSTT-Demo │ │ ├── Bank │ │ ├── Account.cs │ │ ├── Bank.cs │ │ └── Bank.csproj │ │ ├── BankProgram │ │ ├── App.config │ │ ├── BankProgram.csproj │ │ ├── Program.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── TestBank │ │ ├── AccountTest.cs │ │ ├── BankTest.cs │ │ ├── TestBank.csproj │ │ └── packages.config │ │ └── Unit-Testing-Demos.sln ├── homework │ └── README.md ├── imgs │ ├── pic00.png │ ├── pic02.png │ ├── pic04.png │ ├── pic06.png │ ├── pic07.png │ ├── pic08.png │ ├── pic09.png │ ├── pic10.png │ ├── pic11.png │ ├── pic12.png │ ├── pic13.png │ ├── pic16.png │ ├── pic17.png │ ├── pic19.png │ ├── pic20.png │ ├── pic21.png │ ├── pic25.png │ ├── pic26.png │ ├── pic27.png │ ├── pic28.png │ ├── pic29.png │ ├── pic30.png │ ├── pic31.png │ ├── pic32.png │ ├── pic33.png │ ├── pic35.png │ ├── pic36.png │ ├── pic37.png │ ├── pic38.png │ └── tests-pyramid.jpg └── index.html ├── 02. Test-Driven Development ├── README.md ├── demos │ ├── Cards │ │ ├── Card.cs │ │ ├── CardFace.cs │ │ ├── CardSuit.cs │ │ ├── Hand.cs │ │ ├── ICard.cs │ │ ├── IHand.cs │ │ ├── IPokerHandsChecker.cs │ │ ├── Poker.csproj │ │ ├── PokerExample.cs │ │ ├── PokerHandsChecker.cs │ │ └── Test-Driven-Development-Demo+Homework.sln │ └── Tasker │ │ ├── Tasker.Tests │ │ ├── Core │ │ │ ├── Provider │ │ │ │ ├── ConsoleLoggerTests │ │ │ │ │ └── LogTests.cs │ │ │ │ └── IdProviderTests │ │ │ │ │ └── NextIdTests.cs │ │ │ └── TaskManagerTests │ │ │ │ ├── AddTests.cs │ │ │ │ └── Fakes │ │ │ │ └── TaskManagerFake.cs │ │ ├── Models │ │ │ └── TaskTests │ │ │ │ ├── CtorTests.cs │ │ │ │ ├── DescriptionTests.cs │ │ │ │ └── IdTests.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── Tasker.Tests.csproj │ │ └── packages.config │ │ ├── Tasker.sln │ │ └── Tasker │ │ ├── App.config │ │ ├── Core │ │ ├── Contracts │ │ │ ├── IIdProvider.cs │ │ │ └── ILogger.cs │ │ ├── Providers │ │ │ ├── ConsoleLogger.cs │ │ │ └── IdProvider.cs │ │ └── TaskManager.cs │ │ ├── Models │ │ ├── Contracts │ │ │ └── ITask.cs │ │ └── Task.cs │ │ ├── Program.cs │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ └── Tasker.csproj ├── homewrok │ └── README.md └── index.html ├── 03. Mocking and JustMock ├── README.md ├── demos │ ├── Cars-Example │ │ ├── Cars.Tests.JustMock │ │ │ ├── Cars.Tests.JustMock.csproj │ │ │ ├── CarsControllerTests.cs │ │ │ ├── Mocks │ │ │ │ ├── CarRepositoryMock.cs │ │ │ │ ├── ICarsRepositoryMock.cs │ │ │ │ ├── JustMockCarsRepository.cs │ │ │ │ └── MoqCarsRepository.cs │ │ │ ├── Properties │ │ │ │ └── AssemblyInfo.cs │ │ │ └── packages.config │ │ ├── Cars.jmconfig │ │ ├── Cars.sln │ │ ├── Cars │ │ │ ├── Cars.csproj │ │ │ ├── Contracts │ │ │ │ ├── ICarsRepository.cs │ │ │ │ ├── IDatabase.cs │ │ │ │ └── IView.cs │ │ │ ├── Controllers │ │ │ │ └── CarsController.cs │ │ │ ├── Data │ │ │ │ ├── CarsRepository.cs │ │ │ │ └── Database.cs │ │ │ ├── Infrastructure │ │ │ │ └── View.cs │ │ │ ├── Models │ │ │ │ └── Car.cs │ │ │ └── Properties │ │ │ │ └── AssemblyInfo.cs │ │ └── README.txt │ └── TaskManager-Example │ │ ├── Tasker.Tests │ │ ├── Core │ │ │ ├── Fakes │ │ │ │ └── FakeTask.cs │ │ │ ├── Providers │ │ │ │ └── IdProviderTests.cs │ │ │ └── TaskManagerTests.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── Tasker.Tests.csproj │ │ └── packages.config │ │ ├── Tasker.sln │ │ └── Tasker │ │ ├── App.config │ │ ├── Core │ │ ├── Contracts │ │ │ ├── IIdProvider.cs │ │ │ ├── ILogger.cs │ │ │ └── ITaskManager.cs │ │ ├── Providers │ │ │ ├── ConsoleLogger.cs │ │ │ └── IdProvider.cs │ │ └── TaskManager.cs │ │ ├── Models │ │ ├── Contracts │ │ │ └── ITask.cs │ │ └── Task.cs │ │ ├── Program.cs │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ └── Tasker.csproj ├── homework │ └── README.md ├── imgs │ ├── pic00.png │ ├── pic01.png │ ├── pic02.png │ ├── pic03.png │ ├── pic04.png │ ├── pic05.png │ ├── pic06.png │ ├── pic07.png │ ├── pic08.png │ ├── pic09.png │ ├── pic10.png │ └── pic11.png └── index.html ├── 04. Workshops ├── Workshop (Students) │ ├── Academy │ │ └── Workshop │ │ │ ├── Academy.Tests │ │ │ ├── Academy.Tests.csproj │ │ │ ├── Commands │ │ │ │ ├── Adding │ │ │ │ │ ├── AddStudentToCourseCommandTests │ │ │ │ │ │ └── Execute_Should.cs │ │ │ │ │ └── AddStudentToSeasonCommandTests │ │ │ │ │ │ ├── Constructor_Should.cs │ │ │ │ │ │ └── Execute_Should.cs │ │ │ │ └── Mocks │ │ │ │ │ └── AddStudentToSeasonCommandMock.cs │ │ │ ├── Core │ │ │ │ └── FactoriesTests │ │ │ │ │ └── AcademyFactoryTests │ │ │ │ │ ├── CreateLectureResource_Should.cs │ │ │ │ │ ├── CreateSeason_Should.cs │ │ │ │ │ └── Instance_Should.cs │ │ │ ├── Models │ │ │ │ ├── CourseTests │ │ │ │ │ ├── Constructor_Should.cs │ │ │ │ │ ├── EndingDate_Should.cs │ │ │ │ │ ├── LecturesPerWeek_Should.cs │ │ │ │ │ ├── Name_Should.cs │ │ │ │ │ ├── StartingDate_Should.cs │ │ │ │ │ └── ToString_Should.cs │ │ │ │ └── SeasonTests │ │ │ │ │ └── ListUsers_Should.cs │ │ │ ├── Properties │ │ │ │ └── AssemblyInfo.cs │ │ │ ├── app.config │ │ │ └── packages.config │ │ │ ├── Academy.sln │ │ │ ├── Academy │ │ │ ├── Academy.csproj │ │ │ ├── App.config │ │ │ ├── Commands │ │ │ │ ├── Adding │ │ │ │ │ ├── AddStudentToCourseCommand.cs │ │ │ │ │ ├── AddStudentToSeasonCommand.cs │ │ │ │ │ └── AddTrainerToSeasonCommand.cs │ │ │ │ ├── Contracts │ │ │ │ │ └── ICommand.cs │ │ │ │ ├── Creating │ │ │ │ │ ├── CreateCourseCommand.cs │ │ │ │ │ ├── CreateCourseResultCommand.cs │ │ │ │ │ ├── CreateLectureCommand.cs │ │ │ │ │ ├── CreateLectureResourceCommand.cs │ │ │ │ │ ├── CreateSeasonCommand.cs │ │ │ │ │ ├── CreateStudentCommand.cs │ │ │ │ │ └── CreateTrainerCommand.cs │ │ │ │ └── Listing │ │ │ │ │ ├── ListCoursesInSeasonCommand.cs │ │ │ │ │ ├── ListUsersCommand.cs │ │ │ │ │ └── ListUsersInSeasonCommand.cs │ │ │ ├── Core │ │ │ │ ├── Contracts │ │ │ │ │ ├── IEngine.cs │ │ │ │ │ ├── IParser.cs │ │ │ │ │ ├── IReader.cs │ │ │ │ │ └── IWriter.cs │ │ │ │ ├── Engine.cs │ │ │ │ ├── Factories │ │ │ │ │ ├── AcademyFactory.cs │ │ │ │ │ └── IAcademyFactory.cs │ │ │ │ └── Providers │ │ │ │ │ ├── CommandParser.cs │ │ │ │ │ ├── ConsoleReader.cs │ │ │ │ │ ├── ConsoleWriter.cs │ │ │ │ │ └── DateTimeProvider.cs │ │ │ ├── Models │ │ │ │ ├── Abstractions │ │ │ │ │ └── User.cs │ │ │ │ ├── Contracts │ │ │ │ │ ├── ICourse.cs │ │ │ │ │ ├── ILecture.cs │ │ │ │ │ ├── ISeason.cs │ │ │ │ │ ├── IStudent.cs │ │ │ │ │ ├── ITrainer.cs │ │ │ │ │ └── IUser.cs │ │ │ │ ├── Course.cs │ │ │ │ ├── Enums │ │ │ │ │ ├── Grade.cs │ │ │ │ │ ├── Initiative.cs │ │ │ │ │ └── Track.cs │ │ │ │ ├── Lecture.cs │ │ │ │ ├── Season.cs │ │ │ │ ├── Student.cs │ │ │ │ ├── Trainer.cs │ │ │ │ └── Utils │ │ │ │ │ ├── Contracts │ │ │ │ │ ├── ICourseResult.cs │ │ │ │ │ └── ILectureResource.cs │ │ │ │ │ ├── CourseResult.cs │ │ │ │ │ └── LectureResources │ │ │ │ │ ├── Abstractions │ │ │ │ │ └── Resource.cs │ │ │ │ │ ├── DemoResource.cs │ │ │ │ │ ├── HomeworkResource.cs │ │ │ │ │ ├── PresentationResource.cs │ │ │ │ │ └── VideoResource.cs │ │ │ ├── Properties │ │ │ │ └── AssemblyInfo.cs │ │ │ └── Startup.cs │ │ │ └── README.md │ └── Cosmetics │ │ ├── README.md │ │ ├── Solution │ │ ├── Cosmetics.Tests │ │ │ ├── Common │ │ │ │ └── ValidatorTests.cs │ │ │ ├── Cosmetics.Tests.csproj │ │ │ ├── Engine │ │ │ │ ├── CommandTests.cs │ │ │ │ ├── CosmeticsEngineTests.cs │ │ │ │ ├── CosmeticsFactoryTests.cs │ │ │ │ └── Mocks │ │ │ │ │ └── MockedCosmeticsEngine.cs │ │ │ ├── Products │ │ │ │ ├── CategoryTests.cs │ │ │ │ ├── Mocks │ │ │ │ │ ├── MockedCategory.cs │ │ │ │ │ └── MockedShoppingCart.cs │ │ │ │ ├── ShampooTests.cs │ │ │ │ ├── ShoppingCartTests.cs │ │ │ │ └── ToothpasteTests.cs │ │ │ ├── Properties │ │ │ │ └── AssemblyInfo.cs │ │ │ └── packages.config │ │ ├── Cosmetics.sln │ │ └── Cosmetics │ │ │ ├── App.config │ │ │ ├── Common │ │ │ ├── GenderType.cs │ │ │ ├── GlobalErrorMessages.cs │ │ │ ├── UsageType.cs │ │ │ └── Validator.cs │ │ │ ├── Contracts │ │ │ ├── ICategory.cs │ │ │ ├── ICommand.cs │ │ │ ├── ICommandParser.cs │ │ │ ├── ICosmeticsFactory.cs │ │ │ ├── IEngine.cs │ │ │ ├── IProduct.cs │ │ │ ├── IShampoo.cs │ │ │ ├── IShoppingCart.cs │ │ │ └── IToothpaste.cs │ │ │ ├── Cosmetics.csproj │ │ │ ├── CosmeticsProgram.cs │ │ │ ├── Engine │ │ │ ├── Command.cs │ │ │ ├── ConsoleCommandParser.cs │ │ │ ├── CosmeticsEngine.cs │ │ │ └── CosmeticsFactory.cs │ │ │ ├── Products │ │ │ ├── Category.cs │ │ │ ├── Product.cs │ │ │ ├── Shampoo.cs │ │ │ ├── ShoppingCart.cs │ │ │ └── Toothpaste.cs │ │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ │ └── Tests │ │ ├── test.000.001.in.txt │ │ ├── test.000.001.out.txt │ │ ├── test.001.in.txt │ │ ├── test.001.out.txt │ │ ├── test.002.in.txt │ │ ├── test.002.out.txt │ │ ├── test.003.in.txt │ │ ├── test.003.out.txt │ │ ├── test.004.in.txt │ │ ├── test.004.out.txt │ │ ├── test.005.in.txt │ │ ├── test.005.out.txt │ │ ├── test.006.in.txt │ │ ├── test.006.out.txt │ │ ├── test.007.in.txt │ │ ├── test.007.out.txt │ │ ├── test.008.in.txt │ │ ├── test.008.out.txt │ │ ├── test.009.in.txt │ │ ├── test.009.out.txt │ │ ├── test.010.in.txt │ │ └── test.010.out.txt └── Workshop (Trainers) │ ├── Academy │ └── Workshop │ │ ├── Academy.Tests │ │ ├── Academy.Tests.csproj │ │ ├── Commands │ │ │ └── Adding │ │ │ │ ├── AddingToSeasonCommandTests │ │ │ │ ├── Constructor_Should.cs │ │ │ │ └── Execute_Should.cs │ │ │ │ └── Mocks │ │ │ │ └── AddingToSeasonCommandMock.cs │ │ ├── Core │ │ │ └── Factories │ │ │ │ └── AcademyFactoryTests │ │ │ │ └── CreateLectureResource_Should.cs │ │ ├── Models │ │ │ ├── Abstractions │ │ │ │ ├── Mocks │ │ │ │ │ └── UserMock.cs │ │ │ │ └── UserTests │ │ │ │ │ └── GetUsername_Should.cs │ │ │ └── CourseTests │ │ │ │ ├── Constructor_Should.cs │ │ │ │ ├── GetName_Should.cs │ │ │ │ ├── SetName_Should.cs │ │ │ │ └── ToString_Should.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── app.config │ │ └── packages.config │ │ ├── Academy.sln │ │ ├── Academy │ │ ├── Academy.csproj │ │ ├── App.config │ │ ├── Commands │ │ │ ├── Adding │ │ │ │ ├── AddStudentToCourseCommand.cs │ │ │ │ ├── AddStudentToSeasonCommand.cs │ │ │ │ └── AddTrainerToSeasonCommand.cs │ │ │ ├── Contracts │ │ │ │ └── ICommand.cs │ │ │ ├── Creating │ │ │ │ ├── CreateCourseCommand.cs │ │ │ │ ├── CreateCourseResultCommand.cs │ │ │ │ ├── CreateLectureCommand.cs │ │ │ │ ├── CreateLectureResourceCommand.cs │ │ │ │ ├── CreateSeasonCommand.cs │ │ │ │ ├── CreateStudentCommand.cs │ │ │ │ └── CreateTrainerCommand.cs │ │ │ └── Listing │ │ │ │ ├── ListCoursesInSeasonCommand.cs │ │ │ │ ├── ListUsersCommand.cs │ │ │ │ └── ListUsersInSeasonCommand.cs │ │ ├── Core │ │ │ ├── Contracts │ │ │ │ ├── IEngine.cs │ │ │ │ ├── IParser.cs │ │ │ │ ├── IReader.cs │ │ │ │ └── IWriter.cs │ │ │ ├── Engine.cs │ │ │ ├── Factories │ │ │ │ ├── AcademyFactory.cs │ │ │ │ └── IAcademyFactory.cs │ │ │ └── Providers │ │ │ │ ├── CommandParser.cs │ │ │ │ ├── ConsoleReader.cs │ │ │ │ ├── ConsoleWriter.cs │ │ │ │ └── DateTimeProvider.cs │ │ ├── Models │ │ │ ├── Abstractions │ │ │ │ └── User.cs │ │ │ ├── Contracts │ │ │ │ ├── ICourse.cs │ │ │ │ ├── ILecture.cs │ │ │ │ ├── ISeason.cs │ │ │ │ ├── IStudent.cs │ │ │ │ ├── ITrainer.cs │ │ │ │ └── IUser.cs │ │ │ ├── Course.cs │ │ │ ├── Enums │ │ │ │ ├── Grade.cs │ │ │ │ ├── Initiative.cs │ │ │ │ └── Track.cs │ │ │ ├── Lecture.cs │ │ │ ├── Season.cs │ │ │ ├── Student.cs │ │ │ ├── Trainer.cs │ │ │ └── Utils │ │ │ │ ├── Contracts │ │ │ │ ├── ICourseResult.cs │ │ │ │ └── ILectureResource.cs │ │ │ │ ├── CourseResult.cs │ │ │ │ └── LectureResources │ │ │ │ ├── Abstractions │ │ │ │ └── Resource.cs │ │ │ │ ├── DemoResource.cs │ │ │ │ ├── HomeworkResource.cs │ │ │ │ ├── PresentationResource.cs │ │ │ │ └── VideoResource.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── Startup.cs │ │ └── README.md │ ├── ArmyOfCreatures-Evening-livedemo │ └── ArmyOfCreatures-All │ │ ├── Solution │ │ ├── .gitignore │ │ ├── ArmyOfCreatures.Tests │ │ │ ├── ArmyOfCreatures.Tests.csproj │ │ │ ├── BattleManagerAddCreaturesTests.cs │ │ │ ├── BattleManagerAttackTests.cs │ │ │ ├── CreatureIdentifierTests.cs │ │ │ ├── CreaturesFactoryTests.cs │ │ │ ├── MockedClasses │ │ │ │ └── MockedBattleManager.cs │ │ │ ├── Properties │ │ │ │ └── AssemblyInfo.cs │ │ │ ├── TestTest.cs │ │ │ └── packages.config │ │ ├── ArmyOfCreatures.sln │ │ ├── ArmyOfCreatures │ │ │ ├── App.config │ │ │ ├── ArmyOfCreatures.csproj │ │ │ ├── Console │ │ │ │ ├── Commands │ │ │ │ │ ├── AddCommand.cs │ │ │ │ │ ├── AttackCommand.cs │ │ │ │ │ ├── CommandManager.cs │ │ │ │ │ ├── ExitCommand.cs │ │ │ │ │ ├── ICommand.cs │ │ │ │ │ ├── ICommandManager.cs │ │ │ │ │ └── SkipCommand.cs │ │ │ │ ├── ConsoleWriter.cs │ │ │ │ └── Program.cs │ │ │ ├── Extended │ │ │ │ ├── BattleManagerWithThreeArmies.cs │ │ │ │ ├── Creatures │ │ │ │ │ ├── AncientBehemoth.cs │ │ │ │ │ ├── CyclopsKing.cs │ │ │ │ │ ├── Goblin.cs │ │ │ │ │ ├── Griffin.cs │ │ │ │ │ └── WolfRaider.cs │ │ │ │ ├── ExtendedCreaturesFactory.cs │ │ │ │ └── Specialties │ │ │ │ │ ├── AddAttackWhenSkip.cs │ │ │ │ │ ├── DoubleAttackWhenAttacking.cs │ │ │ │ │ └── DoubleDamage.cs │ │ │ ├── Logic │ │ │ │ ├── Battles │ │ │ │ │ ├── BattleManager.cs │ │ │ │ │ ├── CreatureIdentifier.cs │ │ │ │ │ ├── CreaturesInBattle.cs │ │ │ │ │ ├── IBattleManager.cs │ │ │ │ │ └── ICreaturesInBattle.cs │ │ │ │ ├── Creatures │ │ │ │ │ ├── Angel.cs │ │ │ │ │ ├── ArchDevil.cs │ │ │ │ │ ├── Archangel.cs │ │ │ │ │ ├── Behemoth.cs │ │ │ │ │ ├── Creature.cs │ │ │ │ │ └── Devil.cs │ │ │ │ ├── CreaturesFactory.cs │ │ │ │ ├── ICreaturesFactory.cs │ │ │ │ ├── ILogger.cs │ │ │ │ └── Specialties │ │ │ │ │ ├── AddDefenseWhenSkip.cs │ │ │ │ │ ├── DoubleDefenseWhenDefending.cs │ │ │ │ │ ├── Hate.cs │ │ │ │ │ ├── ReduceEnemyDefenseByPercentage.cs │ │ │ │ │ ├── Resurrection.cs │ │ │ │ │ └── Specialty.cs │ │ │ └── Properties │ │ │ │ └── AssemblyInfo.cs │ │ └── Settings.StyleCop │ │ └── Tests │ │ ├── test.000.001.in.txt │ │ ├── test.000.001.out.txt │ │ ├── test.000.002.in.txt │ │ ├── test.000.002.out.txt │ │ ├── test.001.in.txt │ │ ├── test.001.out.txt │ │ ├── test.002.in.txt │ │ ├── test.002.out.txt │ │ ├── test.003.in.txt │ │ ├── test.003.out.txt │ │ ├── test.004.in.txt │ │ ├── test.004.out.txt │ │ ├── test.005.in.txt │ │ ├── test.005.out.txt │ │ ├── test.006.in.txt │ │ ├── test.006.out.txt │ │ ├── test.007.in.txt │ │ ├── test.007.out.txt │ │ ├── test.008.in.txt │ │ ├── test.008.out.txt │ │ ├── test.009.in.txt │ │ ├── test.009.out.txt │ │ ├── test.010.in.txt │ │ └── test.010.out.txt │ └── Live-Demo-Morning-Lecture │ ├── .gitignore │ ├── ArmyOfCreatures.Tests │ ├── ArmyOfCreatures.Tests.csproj │ ├── BattleManagerTests.cs │ ├── ExtendedCreaturesFactoryTests.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── packages.config │ ├── ArmyOfCreatures.sln │ ├── ArmyOfCreatures │ ├── App.config │ ├── ArmyOfCreatures.csproj │ ├── Console │ │ ├── Commands │ │ │ ├── AddCommand.cs │ │ │ ├── AttackCommand.cs │ │ │ ├── CommandManager.cs │ │ │ ├── ExitCommand.cs │ │ │ ├── ICommand.cs │ │ │ ├── ICommandManager.cs │ │ │ └── SkipCommand.cs │ │ ├── ConsoleWriter.cs │ │ └── Program.cs │ ├── Extended │ │ ├── BattleManagerWithThreeArmies.cs │ │ ├── Creatures │ │ │ ├── AncientBehemoth.cs │ │ │ ├── CyclopsKing.cs │ │ │ ├── Goblin.cs │ │ │ ├── Griffin.cs │ │ │ └── WolfRaider.cs │ │ ├── ExtendedCreaturesFactory.cs │ │ └── Specialties │ │ │ ├── AddAttackWhenSkip.cs │ │ │ ├── DoubleAttackWhenAttacking.cs │ │ │ └── DoubleDamage.cs │ ├── Logic │ │ ├── Battles │ │ │ ├── BattleManager.cs │ │ │ ├── CreatureIdentifier.cs │ │ │ ├── CreaturesInBattle.cs │ │ │ ├── IBattleManager.cs │ │ │ └── ICreaturesInBattle.cs │ │ ├── Creatures │ │ │ ├── Angel.cs │ │ │ ├── ArchDevil.cs │ │ │ ├── Archangel.cs │ │ │ ├── Behemoth.cs │ │ │ ├── Creature.cs │ │ │ └── Devil.cs │ │ ├── CreaturesFactory.cs │ │ ├── ICreaturesFactory.cs │ │ ├── ILogger.cs │ │ └── Specialties │ │ │ ├── AddDefenseWhenSkip.cs │ │ │ ├── DoubleDefenseWhenDefending.cs │ │ │ ├── Hate.cs │ │ │ ├── ReduceEnemyDefenseByPercentage.cs │ │ │ ├── Resurrection.cs │ │ │ └── Specialty.cs │ └── Properties │ │ └── AssemblyInfo.cs │ ├── Settings.StyleCop │ └── ТestsRequirements.md ├── Exams ├── 2016_07 │ ├── Exam_Author solution │ │ ├── IntergalacticTravel.Tests │ │ │ ├── BusinessOwner │ │ │ │ └── CollectProfits_Should.cs │ │ │ ├── IntergalacticTravel.Tests.csproj │ │ │ ├── Properties │ │ │ │ └── AssemblyInfo.cs │ │ │ ├── ResourcesFactory │ │ │ │ └── GetResources_Should.cs │ │ │ ├── TeleportStation │ │ │ │ ├── Constructor_Should.cs │ │ │ │ ├── PayProfits_Should.cs │ │ │ │ └── TeleportUnit_Should.cs │ │ │ ├── Unit │ │ │ │ └── Pay_Should.cs │ │ │ ├── UnitsFactory │ │ │ │ └── GetUnit_Should.cs │ │ │ └── packages.config │ │ ├── IntergalacticTravel.sln │ │ └── IntergalacticTravel │ │ │ ├── BusinessOwner.cs │ │ │ ├── Constants │ │ │ └── GlobalConstants.cs │ │ │ ├── Contracts │ │ │ ├── IBusinessOwner.cs │ │ │ ├── IGPSCoordinates.cs │ │ │ ├── IGalaxy.cs │ │ │ ├── ILocation.cs │ │ │ ├── INameable.cs │ │ │ ├── IPath.cs │ │ │ ├── IPlanet.cs │ │ │ ├── IResources.cs │ │ │ ├── IResourcesFactory.cs │ │ │ ├── ITeleportStation.cs │ │ │ └── IUnit.cs │ │ │ ├── Exceptions │ │ │ ├── InsufficientResourcesException.cs │ │ │ ├── InvalidTeleportationLocationException.cs │ │ │ ├── InvalidUnitCreationCommandException.cs │ │ │ ├── LocationNotFoundException.cs │ │ │ └── TeleportOutOfRangeException.cs │ │ │ ├── ExtendedTeleportStation.cs │ │ │ ├── Extensions │ │ │ ├── IEnumerableExtensions.cs │ │ │ └── ObjectExtensions.cs │ │ │ ├── IntergalacticTravel.csproj │ │ │ ├── Lacaille.cs │ │ │ ├── Luyten.cs │ │ │ ├── Procyon.cs │ │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ │ ├── Resources.cs │ │ │ ├── ResourcesFactory.cs │ │ │ ├── TeleportStation.cs │ │ │ ├── TheOneThatRulesThemAll.cs │ │ │ ├── Unit.cs │ │ │ └── UnitsFactory.cs │ └── Exam_Skeleton │ │ ├── IntergalacticTravel.Tests │ │ ├── IntergalacticTravel.Tests.csproj │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── packages.config │ │ ├── IntergalacticTravel.sln │ │ ├── IntergalacticTravel │ │ ├── BusinessOwner.cs │ │ ├── Constants │ │ │ └── GlobalConstants.cs │ │ ├── Contracts │ │ │ ├── IBusinessOwner.cs │ │ │ ├── IGPSCoordinates.cs │ │ │ ├── IGalaxy.cs │ │ │ ├── ILocation.cs │ │ │ ├── INameable.cs │ │ │ ├── IPath.cs │ │ │ ├── IPlanet.cs │ │ │ ├── IResources.cs │ │ │ ├── IResourcesFactory.cs │ │ │ ├── ITeleportStation.cs │ │ │ └── IUnit.cs │ │ ├── Exceptions │ │ │ ├── InsufficientResourcesException.cs │ │ │ ├── InvalidTeleportationLocationException.cs │ │ │ ├── InvalidUnitCreationCommandException.cs │ │ │ ├── LocationNotFoundException.cs │ │ │ └── TeleportOutOfRangeException.cs │ │ ├── Extensions │ │ │ ├── IEnumerableExtensions.cs │ │ │ └── ObjectExtensions.cs │ │ ├── IntergalacticTravel.csproj │ │ ├── Lacaille.cs │ │ ├── Luyten.cs │ │ ├── Procyon.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── Resources.cs │ │ ├── ResourcesFactory.cs │ │ ├── TeleportStation.cs │ │ ├── Unit.cs │ │ └── UnitsFactory.cs │ │ ├── README.html │ │ └── README.md └── 2017_01 │ ├── Exam_AuthorSolution │ ├── AcademyPackageManager.Tests │ │ ├── AcademyPackageManager.Tests.csproj │ │ ├── Commands │ │ │ ├── InstallCommandTests │ │ │ │ ├── Constructor_Should.cs │ │ │ │ └── Execute_Should.cs │ │ │ └── Mocks │ │ │ │ └── InstallCommandMock.cs │ │ ├── Core │ │ │ └── PackageInstallerTests │ │ │ │ ├── Constructor_Should.cs │ │ │ │ ├── Mocks │ │ │ │ └── PackageInstallerMock.cs │ │ │ │ └── PerformOperation_Should.cs │ │ ├── CustomExceptions │ │ │ └── UpdateMethodCalledException.cs │ │ ├── Models │ │ │ ├── PackageTests │ │ │ │ ├── CompareTo_Should.cs │ │ │ │ ├── Constructor_Should.cs │ │ │ │ └── Equals_Should.cs │ │ │ ├── PackageVersionTests │ │ │ │ └── Constructor_Should.cs │ │ │ └── ProjectTests │ │ │ │ └── Constructor_Should.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── Repositories │ │ │ ├── Mocks │ │ │ │ └── PackageRepositoryMock.cs │ │ │ └── PackageRepositoryTests │ │ │ │ ├── Add_Should.cs │ │ │ │ ├── Delete_Should.cs │ │ │ │ ├── GetAll_Should.cs │ │ │ │ └── Update_Should.cs │ │ └── packages.config │ ├── AcademyPackageManager.sln │ └── PackageManager │ │ ├── Commands │ │ ├── Contracts │ │ │ └── ICommand.cs │ │ ├── InstallCommand.cs │ │ ├── UninstallCommand.cs │ │ └── UpdateCommand.cs │ │ ├── Core │ │ ├── Contracts │ │ │ ├── IDownloader.cs │ │ │ ├── IInstaller.cs │ │ │ └── IManager.cs │ │ ├── DirectoryManager.cs │ │ ├── PackageDownloader.cs │ │ └── PackageInstaller.cs │ │ ├── Enums │ │ ├── InstallerOperation.cs │ │ └── VersionType.cs │ │ ├── Info │ │ ├── ConsoleLogger.cs │ │ └── Contracts │ │ │ └── ILogger.cs │ │ ├── Models │ │ ├── Contracts │ │ │ ├── IPackage.cs │ │ │ ├── IProject.cs │ │ │ └── IVersion.cs │ │ ├── Package.cs │ │ ├── PackageVersion.cs │ │ └── Project.cs │ │ ├── PackageManager.csproj │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ └── Repositories │ │ ├── Contracts │ │ └── IRepository.cs │ │ └── PackageRepository.cs │ └── Exam_Skeleton │ ├── AcademyPackageManager │ ├── AcademyPackageManager.sln │ ├── PackageManager.Tests │ │ ├── PackageManager.Tests.csproj │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ └── PackageManager │ │ ├── Commands │ │ ├── Contracts │ │ │ └── ICommand.cs │ │ ├── InstallCommand.cs │ │ ├── UninstallCommand.cs │ │ └── UpdateCommand.cs │ │ ├── Core │ │ ├── Contracts │ │ │ ├── IDownloader.cs │ │ │ ├── IInstaller.cs │ │ │ └── IManager.cs │ │ ├── PackageDownloader.cs │ │ └── PackageInstaller.cs │ │ ├── Enums │ │ ├── InstallerOperation.cs │ │ └── VersionType.cs │ │ ├── Info │ │ ├── ConsoleLogger.cs │ │ └── Contracts │ │ │ └── ILogger.cs │ │ ├── Models │ │ ├── Contracts │ │ │ ├── IPackage.cs │ │ │ ├── IProject.cs │ │ │ └── IVersion.cs │ │ ├── Package.cs │ │ ├── PackageVersion.cs │ │ └── Project.cs │ │ ├── PackageManager.csproj │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ └── Repositories │ │ ├── Contracts │ │ └── IRepository.cs │ │ └── PackageRepository.cs │ ├── Bug_Found.txt │ └── README.md └── README.md /Topics/00. Course-intro/imgs/award.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/award.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/images.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/images.jpg -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/ninja.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/ninja.jpg -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic00.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic01.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic02.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic03.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic04.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic05.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic06.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic07.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic08.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic09.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic10.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic11.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic12.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic13.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic14.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic15.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic16.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic17.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic18.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic18.jpg -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic18.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic19.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic20.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic21.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic22.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic22.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic23.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic23.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic24.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic25.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic25.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic26.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic26.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic27.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic27.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic28.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic28.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic29.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic30.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic30.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic31.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic31.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic32.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic33.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic33.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic34.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic34.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic35.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic35.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic36.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic37.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic37.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic38.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic38.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic39.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic39.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic40.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic41.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic41.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic42.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic42.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic43.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic43.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic44.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic44.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic45.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic45.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic46.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic46.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic47.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic47.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic48.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic49.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic49.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic50.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic51.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic51.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic52.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic52.png -------------------------------------------------------------------------------- /Topics/00. Course-intro/imgs/pic53.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Course-intro/imgs/pic53.png -------------------------------------------------------------------------------- /Topics/00. Software engineering/imgs/pic00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Software engineering/imgs/pic00.png -------------------------------------------------------------------------------- /Topics/00. Software engineering/imgs/pic02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Software engineering/imgs/pic02.png -------------------------------------------------------------------------------- /Topics/00. Software engineering/imgs/pic04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Software engineering/imgs/pic04.png -------------------------------------------------------------------------------- /Topics/00. Software engineering/imgs/pic06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Software engineering/imgs/pic06.png -------------------------------------------------------------------------------- /Topics/00. Software engineering/imgs/pic07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Software engineering/imgs/pic07.png -------------------------------------------------------------------------------- /Topics/00. Software engineering/imgs/pic08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Software engineering/imgs/pic08.png -------------------------------------------------------------------------------- /Topics/00. Software engineering/imgs/pic09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Software engineering/imgs/pic09.png -------------------------------------------------------------------------------- /Topics/00. Software engineering/imgs/pic10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Software engineering/imgs/pic10.png -------------------------------------------------------------------------------- /Topics/00. Software engineering/imgs/pic11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Software engineering/imgs/pic11.png -------------------------------------------------------------------------------- /Topics/00. Software engineering/imgs/pic12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Software engineering/imgs/pic12.png -------------------------------------------------------------------------------- /Topics/00. Software engineering/imgs/pic13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Software engineering/imgs/pic13.png -------------------------------------------------------------------------------- /Topics/00. Software engineering/imgs/pic16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Software engineering/imgs/pic16.png -------------------------------------------------------------------------------- /Topics/00. Software engineering/imgs/pic17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Software engineering/imgs/pic17.png -------------------------------------------------------------------------------- /Topics/00. Software engineering/imgs/pic19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Software engineering/imgs/pic19.png -------------------------------------------------------------------------------- /Topics/00. Software engineering/imgs/pic20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Software engineering/imgs/pic20.png -------------------------------------------------------------------------------- /Topics/00. Software engineering/imgs/pic21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Software engineering/imgs/pic21.png -------------------------------------------------------------------------------- /Topics/00. Software engineering/imgs/pic25.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Software engineering/imgs/pic25.png -------------------------------------------------------------------------------- /Topics/00. Software engineering/imgs/pic26.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Software engineering/imgs/pic26.png -------------------------------------------------------------------------------- /Topics/00. Software engineering/imgs/pic27.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Software engineering/imgs/pic27.png -------------------------------------------------------------------------------- /Topics/00. Software engineering/imgs/pic28.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Software engineering/imgs/pic28.png -------------------------------------------------------------------------------- /Topics/00. Software engineering/imgs/pic29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Software engineering/imgs/pic29.png -------------------------------------------------------------------------------- /Topics/00. Software engineering/imgs/pic30.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Software engineering/imgs/pic30.png -------------------------------------------------------------------------------- /Topics/00. Software engineering/imgs/pic31.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Software engineering/imgs/pic31.png -------------------------------------------------------------------------------- /Topics/00. Software engineering/imgs/pic32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Software engineering/imgs/pic32.png -------------------------------------------------------------------------------- /Topics/00. Software engineering/imgs/pic33.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Software engineering/imgs/pic33.png -------------------------------------------------------------------------------- /Topics/00. Software engineering/imgs/pic35.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Software engineering/imgs/pic35.png -------------------------------------------------------------------------------- /Topics/00. Software engineering/imgs/pic36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Software engineering/imgs/pic36.png -------------------------------------------------------------------------------- /Topics/00. Software engineering/imgs/pic37.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Software engineering/imgs/pic37.png -------------------------------------------------------------------------------- /Topics/00. Software engineering/imgs/pic38.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Software engineering/imgs/pic38.png -------------------------------------------------------------------------------- /Topics/00. Software engineering/imgs/pic39.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/00. Software engineering/imgs/pic39.png -------------------------------------------------------------------------------- /Topics/01. Unit Testing/demos/Live-Demos/Validators/Validators/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Topics/01. Unit Testing/demos/Live-Demos/Validators/Validators/Exceptions/InvalidPasswordException.cs: -------------------------------------------------------------------------------- 1 | namespace Validators.Exceptions 2 | { 3 | using System; 4 | 5 | public class InvalidPasswordException : ArgumentException 6 | { 7 | public InvalidPasswordException(string message) 8 | : base(message) 9 | { 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Topics/01. Unit Testing/demos/Live-Demos/Validators/Validators/Exceptions/InvalidUsernameException.cs: -------------------------------------------------------------------------------- 1 | namespace Validators.Exceptions 2 | { 3 | using System; 4 | 5 | public class InvalidUsernameException : ArgumentException 6 | { 7 | public InvalidUsernameException(string message) 8 | : base(message) 9 | { 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Topics/01. Unit Testing/demos/Live-Demos/Validators/Validators/Helpers/CharHelper.cs: -------------------------------------------------------------------------------- 1 | namespace Validators.Helpers 2 | { 3 | public static class CharHelper 4 | { 5 | public static bool IsSpecialCharacter(char c) 6 | { 7 | string specialCharacters = "!@#$%^&*()_+="; 8 | 9 | for (int i = 0; i < specialCharacters.Length; i++) 10 | { 11 | if(specialCharacters[i]==c) 12 | { 13 | return true; 14 | } 15 | } 16 | 17 | return false; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Topics/01. Unit Testing/demos/Live-Demos/Validators/Validators/Program.cs: -------------------------------------------------------------------------------- 1 | namespace Validators 2 | { 3 | public class Program 4 | { 5 | static void Main(string[] args) 6 | { 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Topics/01. Unit Testing/demos/Live-Demos/Validators/ValidatorsTests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Topics/01. Unit Testing/demos/NUnit-Demo/Bank/Account.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public class Account 4 | { 5 | private float balance = 0; 6 | 7 | public void Deposit(float amount) 8 | { 9 | if (amount == 0) 10 | { 11 | throw new ArgumentException("Can not deposit ammount of 0.00"); 12 | } 13 | balance += amount; 14 | } 15 | 16 | public void Withdraw(float amount) 17 | { 18 | if (amount == 0) 19 | { 20 | throw new ArgumentException("Can not withdrwa ammount of 0.00"); 21 | } 22 | balance -= amount; 23 | } 24 | 25 | public void TransferFunds(Account destinationAcc, float amount) 26 | { 27 | if (destinationAcc == this) 28 | { 29 | throw new ArgumentException( 30 | "Source and destination accounts can not be the same"); 31 | } 32 | balance -= amount; 33 | destinationAcc.balance += amount; 34 | } 35 | 36 | public float Balance 37 | { 38 | get 39 | { 40 | return balance; 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /Topics/01. Unit Testing/demos/NUnit-Demo/TestBank/lib/nunit.framework.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/01. Unit Testing/demos/NUnit-Demo/TestBank/lib/nunit.framework.dll -------------------------------------------------------------------------------- /Topics/01. Unit Testing/demos/TestingFrameworks/Utilities.Tests.MsTest/Data/SumData.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 1,1 5 | 2 6 | 7 | 8 | 9 | 0 10 | 11 | 12 | -1 13 | -1 14 | 15 | 16 | -------------------------------------------------------------------------------- /Topics/01. Unit Testing/demos/TestingFrameworks/Utilities.Tests.MsTest/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Topics/01. Unit Testing/demos/TestingFrameworks/Utilities.Tests.MsTest/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Topics/01. Unit Testing/demos/TestingFrameworks/Utilities.Tests.MsTestV2/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Topics/01. Unit Testing/demos/TestingFrameworks/Utilities.Tests.NUnit/MathUtilsTests.cs: -------------------------------------------------------------------------------- 1 | using NUnit.Framework; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Utilities.Tests.NUnit 9 | { 10 | [TestFixture] 11 | public class MathUtilsTests 12 | { 13 | [Test] 14 | public void ThrowArgumentException_WhenTheListIsNull() 15 | { 16 | // Arrange 17 | var utils = new MathUtils(); 18 | 19 | // Act & Assert 20 | Assert.Throws(() => utils.Sum(null)); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Topics/01. Unit Testing/demos/TestingFrameworks/Utilities.Tests.NUnit/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Topics/01. Unit Testing/demos/TestingFrameworks/Utilities/MathUtils.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Utilities 8 | { 9 | public class MathUtils 10 | { 11 | public int Sum(IEnumerable numbers) 12 | { 13 | if(numbers == null) 14 | { 15 | throw new ArgumentException(); 16 | } 17 | 18 | if(numbers.Count() == 0) 19 | { 20 | return 1; 21 | } 22 | 23 | var sum = numbers.Sum(x => x); 24 | 25 | return sum; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Topics/01. Unit Testing/demos/TestingFrameworks/Utilities/StringUtils.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Text.RegularExpressions; 6 | using System.Threading.Tasks; 7 | 8 | namespace Utilities 9 | { 10 | public class StringUtils 11 | { 12 | public bool ValidateString(string input, string pattern) 13 | { 14 | var match = Regex.Match(input, pattern); 15 | 16 | return match.Success; 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /Topics/01. Unit Testing/demos/VSTT-Demo/BankProgram/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Topics/01. Unit Testing/demos/VSTT-Demo/BankProgram/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace BankProgram 9 | { 10 | class Program 11 | { 12 | static void Main(string[] args) 13 | { 14 | var bank = new Bank(); 15 | 16 | 17 | 18 | Debug.Assert(bank.AccountsCount > 0); 19 | 20 | 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Topics/01. Unit Testing/demos/VSTT-Demo/TestBank/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Topics/01. Unit Testing/imgs/pic00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/01. Unit Testing/imgs/pic00.png -------------------------------------------------------------------------------- /Topics/01. Unit Testing/imgs/pic02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/01. Unit Testing/imgs/pic02.png -------------------------------------------------------------------------------- /Topics/01. Unit Testing/imgs/pic04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/01. Unit Testing/imgs/pic04.png -------------------------------------------------------------------------------- /Topics/01. Unit Testing/imgs/pic06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/01. Unit Testing/imgs/pic06.png -------------------------------------------------------------------------------- /Topics/01. Unit Testing/imgs/pic07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/01. Unit Testing/imgs/pic07.png -------------------------------------------------------------------------------- /Topics/01. Unit Testing/imgs/pic08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/01. Unit Testing/imgs/pic08.png -------------------------------------------------------------------------------- /Topics/01. Unit Testing/imgs/pic09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/01. Unit Testing/imgs/pic09.png -------------------------------------------------------------------------------- /Topics/01. Unit Testing/imgs/pic10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/01. Unit Testing/imgs/pic10.png -------------------------------------------------------------------------------- /Topics/01. Unit Testing/imgs/pic11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/01. Unit Testing/imgs/pic11.png -------------------------------------------------------------------------------- /Topics/01. Unit Testing/imgs/pic12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/01. Unit Testing/imgs/pic12.png -------------------------------------------------------------------------------- /Topics/01. Unit Testing/imgs/pic13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/01. Unit Testing/imgs/pic13.png -------------------------------------------------------------------------------- /Topics/01. Unit Testing/imgs/pic16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/01. Unit Testing/imgs/pic16.png -------------------------------------------------------------------------------- /Topics/01. Unit Testing/imgs/pic17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/01. Unit Testing/imgs/pic17.png -------------------------------------------------------------------------------- /Topics/01. Unit Testing/imgs/pic19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/01. Unit Testing/imgs/pic19.png -------------------------------------------------------------------------------- /Topics/01. Unit Testing/imgs/pic20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/01. Unit Testing/imgs/pic20.png -------------------------------------------------------------------------------- /Topics/01. Unit Testing/imgs/pic21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/01. Unit Testing/imgs/pic21.png -------------------------------------------------------------------------------- /Topics/01. Unit Testing/imgs/pic25.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/01. Unit Testing/imgs/pic25.png -------------------------------------------------------------------------------- /Topics/01. Unit Testing/imgs/pic26.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/01. Unit Testing/imgs/pic26.png -------------------------------------------------------------------------------- /Topics/01. Unit Testing/imgs/pic27.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/01. Unit Testing/imgs/pic27.png -------------------------------------------------------------------------------- /Topics/01. Unit Testing/imgs/pic28.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/01. Unit Testing/imgs/pic28.png -------------------------------------------------------------------------------- /Topics/01. Unit Testing/imgs/pic29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/01. Unit Testing/imgs/pic29.png -------------------------------------------------------------------------------- /Topics/01. Unit Testing/imgs/pic30.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/01. Unit Testing/imgs/pic30.png -------------------------------------------------------------------------------- /Topics/01. Unit Testing/imgs/pic31.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/01. Unit Testing/imgs/pic31.png -------------------------------------------------------------------------------- /Topics/01. Unit Testing/imgs/pic32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/01. Unit Testing/imgs/pic32.png -------------------------------------------------------------------------------- /Topics/01. Unit Testing/imgs/pic33.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/01. Unit Testing/imgs/pic33.png -------------------------------------------------------------------------------- /Topics/01. Unit Testing/imgs/pic35.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/01. Unit Testing/imgs/pic35.png -------------------------------------------------------------------------------- /Topics/01. Unit Testing/imgs/pic36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/01. Unit Testing/imgs/pic36.png -------------------------------------------------------------------------------- /Topics/01. Unit Testing/imgs/pic37.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/01. Unit Testing/imgs/pic37.png -------------------------------------------------------------------------------- /Topics/01. Unit Testing/imgs/pic38.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/01. Unit Testing/imgs/pic38.png -------------------------------------------------------------------------------- /Topics/01. Unit Testing/imgs/tests-pyramid.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/01. Unit Testing/imgs/tests-pyramid.jpg -------------------------------------------------------------------------------- /Topics/02. Test-Driven Development/demos/Cards/Card.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Poker 4 | { 5 | public class Card : ICard 6 | { 7 | public CardFace Face { get; private set; } 8 | public CardSuit Suit { get; private set; } 9 | 10 | public Card(CardFace face, CardSuit suit) 11 | { 12 | this.Face = face; 13 | this.Suit = suit; 14 | } 15 | 16 | public override string ToString() 17 | { 18 | throw new NotImplementedException(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Topics/02. Test-Driven Development/demos/Cards/CardFace.cs: -------------------------------------------------------------------------------- 1 | namespace Poker 2 | { 3 | public enum CardFace 4 | { 5 | Two = 2, 6 | Three = 3, 7 | Four = 4, 8 | Five = 5, 9 | Six = 6, 10 | Seven = 7, 11 | Eight = 8, 12 | Nine = 9, 13 | Ten = 10, 14 | Jack = 11, 15 | Queen = 12, 16 | King = 13, 17 | Ace = 14 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Topics/02. Test-Driven Development/demos/Cards/CardSuit.cs: -------------------------------------------------------------------------------- 1 | namespace Poker 2 | { 3 | public enum CardSuit 4 | { 5 | Clubs = 1, // ♣ 6 | Diamonds = 2, // ♦ 7 | Hearts = 3, // ♥ 8 | Spades = 4 // ♠ 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Topics/02. Test-Driven Development/demos/Cards/Hand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace Poker 5 | { 6 | public class Hand : IHand 7 | { 8 | public IList Cards { get; private set; } 9 | 10 | public Hand(IList cards) 11 | { 12 | this.Cards = cards; 13 | } 14 | 15 | public override string ToString() 16 | { 17 | throw new NotImplementedException(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Topics/02. Test-Driven Development/demos/Cards/ICard.cs: -------------------------------------------------------------------------------- 1 | namespace Poker 2 | { 3 | public interface ICard 4 | { 5 | CardFace Face { get; } 6 | CardSuit Suit { get; } 7 | string ToString(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Topics/02. Test-Driven Development/demos/Cards/IHand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace Poker 5 | { 6 | public interface IHand 7 | { 8 | IList Cards { get; } 9 | string ToString(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Topics/02. Test-Driven Development/demos/Cards/IPokerHandsChecker.cs: -------------------------------------------------------------------------------- 1 | namespace Poker 2 | { 3 | /// 4 | /// Interface for checking poker hands as defined in http://en.wikipedia.org/wiki/List_of_poker_hands. 5 | /// 6 | public interface IPokerHandsChecker 7 | { 8 | bool IsValidHand(IHand hand); 9 | bool IsStraightFlush(IHand hand); 10 | bool IsFourOfAKind(IHand hand); 11 | bool IsFullHouse(IHand hand); 12 | bool IsFlush(IHand hand); 13 | bool IsStraight(IHand hand); 14 | bool IsThreeOfAKind(IHand hand); 15 | bool IsTwoPair(IHand hand); 16 | bool IsOnePair(IHand hand); 17 | bool IsHighCard(IHand hand); 18 | int CompareHands(IHand firstHand, IHand secondHand); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Topics/02. Test-Driven Development/demos/Cards/PokerExample.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace Poker 5 | { 6 | class PokerExample 7 | { 8 | static void Main() 9 | { 10 | ICard card = new Card(CardFace.Ace, CardSuit.Clubs); 11 | Console.WriteLine(card); 12 | 13 | IHand hand = new Hand(new List() { 14 | new Card(CardFace.Ace, CardSuit.Clubs), 15 | new Card(CardFace.Ace, CardSuit.Diamonds), 16 | new Card(CardFace.King, CardSuit.Hearts), 17 | new Card(CardFace.King, CardSuit.Spades), 18 | new Card(CardFace.Seven, CardSuit.Diamonds), 19 | }); 20 | Console.WriteLine(hand); 21 | 22 | IPokerHandsChecker checker = new PokerHandsChecker(); 23 | Console.WriteLine(checker.IsValidHand(hand)); 24 | Console.WriteLine(checker.IsOnePair(hand)); 25 | Console.WriteLine(checker.IsTwoPair(hand)); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Topics/02. Test-Driven Development/demos/Cards/Test-Driven-Development-Demo+Homework.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Poker", "Poker.csproj", "{28FE6BA3-4622-406E-81C4-419B0D2368F9}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Release|Any CPU = Release|Any CPU 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {28FE6BA3-4622-406E-81C4-419B0D2368F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 13 | {28FE6BA3-4622-406E-81C4-419B0D2368F9}.Debug|Any CPU.Build.0 = Debug|Any CPU 14 | {28FE6BA3-4622-406E-81C4-419B0D2368F9}.Release|Any CPU.ActiveCfg = Release|Any CPU 15 | {28FE6BA3-4622-406E-81C4-419B0D2368F9}.Release|Any CPU.Build.0 = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /Topics/02. Test-Driven Development/demos/Tasker/Tasker.Tests/Core/Provider/IdProviderTests/NextIdTests.cs: -------------------------------------------------------------------------------- 1 | using NUnit.Framework; 2 | using Tasker.Core.Providers; 3 | 4 | namespace Tasker.Tests.Core.Provider.IdProviderTests 5 | { 6 | [TestFixture] 7 | public class NextIdTests 8 | { 9 | [Test] 10 | public void NextId_ShouldReturnIncrementedValue_WhenInvoked() 11 | { 12 | var sut = new IdProvider(); 13 | 14 | var resultOne = sut.NextId(); 15 | var resultTwo = sut.NextId(); 16 | 17 | Assert.AreEqual(1, resultTwo - resultOne); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Topics/02. Test-Driven Development/demos/Tasker/Tasker.Tests/Core/TaskManagerTests/Fakes/TaskManagerFake.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Tasker.Core; 7 | using Tasker.Core.Contracts; 8 | using Tasker.Models.Contracts; 9 | 10 | namespace Tasker.Tests.Core.TaskManagerTests.Fakes 11 | { 12 | internal class TaskManagerFake : TaskManager 13 | { 14 | public TaskManagerFake(IIdProvider provider, ILogger logger) : base(provider, logger) 15 | { 16 | } 17 | 18 | public ICollection ExposedTasks 19 | { 20 | get 21 | { 22 | return new List(base.Tasks); 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Topics/02. Test-Driven Development/demos/Tasker/Tasker.Tests/Models/TaskTests/CtorTests.cs: -------------------------------------------------------------------------------- 1 | using NUnit.Framework; 2 | using Tasker.Models; 3 | 4 | namespace Tasker.Tests.Models.TaskTests 5 | { 6 | [TestFixture] 7 | public class CtorTests 8 | { 9 | public void Ctor_ShouldAssignDescription_WhenInvoked() 10 | { 11 | // Arrange && Act 12 | var expected = "Valid Description"; 13 | var sut = new Task(expected); 14 | 15 | // Assert 16 | Assert.AreEqual(expected, sut.Description); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Topics/02. Test-Driven Development/demos/Tasker/Tasker.Tests/Models/TaskTests/DescriptionTests.cs: -------------------------------------------------------------------------------- 1 | using NUnit.Framework; 2 | using System; 3 | using Tasker.Models; 4 | 5 | namespace Tasker.Tests.Models.TaskTests 6 | { 7 | [TestFixture] 8 | public class DescriptionTests 9 | { 10 | [TestCase(null)] 11 | [TestCase("")] 12 | [TestCase(" ")] 13 | public void Description_ShouldThrowArgumentNullException_WhenPassedNullOrEmptyValue(string value) 14 | { 15 | // Arrange 16 | var sut = new Task("Valid Description"); 17 | 18 | // Act && Assert 19 | Assert.Throws(() => sut.Description = value); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Topics/02. Test-Driven Development/demos/Tasker/Tasker.Tests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Topics/02. Test-Driven Development/demos/Tasker/Tasker/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Topics/02. Test-Driven Development/demos/Tasker/Tasker/Core/Contracts/IIdProvider.cs: -------------------------------------------------------------------------------- 1 | namespace Tasker.Core.Contracts 2 | { 3 | public interface IIdProvider 4 | { 5 | int NextId(); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Topics/02. Test-Driven Development/demos/Tasker/Tasker/Core/Contracts/ILogger.cs: -------------------------------------------------------------------------------- 1 | namespace Tasker.Core.Contracts 2 | { 3 | public interface ILogger 4 | { 5 | void Log(string message); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Topics/02. Test-Driven Development/demos/Tasker/Tasker/Core/Providers/ConsoleLogger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Tasker.Core.Contracts; 3 | 4 | namespace Tasker.Core.Providers 5 | { 6 | public class ConsoleLogger : ILogger 7 | { 8 | public void Log(string message) 9 | { 10 | Console.WriteLine(message); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Topics/02. Test-Driven Development/demos/Tasker/Tasker/Core/Providers/IdProvider.cs: -------------------------------------------------------------------------------- 1 | using Tasker.Core.Contracts; 2 | 3 | namespace Tasker.Core.Providers 4 | { 5 | public class IdProvider : IIdProvider 6 | { 7 | private static int currentId = 0; 8 | 9 | public int NextId() 10 | { 11 | return currentId++; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Topics/02. Test-Driven Development/demos/Tasker/Tasker/Models/Contracts/ITask.cs: -------------------------------------------------------------------------------- 1 | namespace Tasker.Models.Contracts 2 | { 3 | public interface ITask 4 | { 5 | int Id { get; set; } 6 | 7 | string Description { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Topics/02. Test-Driven Development/demos/Tasker/Tasker/Program.cs: -------------------------------------------------------------------------------- 1 | namespace Tasker 2 | { 3 | public class Startup 4 | { 5 | public static void Main() 6 | { 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Topics/03. Mocking and JustMock/demos/Cars-Example/Cars.Tests.JustMock/Mocks/ICarsRepositoryMock.cs: -------------------------------------------------------------------------------- 1 | namespace Cars.Tests.JustMock.Mocks 2 | { 3 | using Cars.Contracts; 4 | 5 | public interface ICarsRepositoryMock 6 | { 7 | ICarsRepository CarsData { get; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Topics/03. Mocking and JustMock/demos/Cars-Example/Cars.Tests.JustMock/Mocks/JustMockCarsRepository.cs: -------------------------------------------------------------------------------- 1 | namespace Cars.Tests.JustMock.Mocks 2 | { 3 | using System.Linq; 4 | 5 | using Cars.Contracts; 6 | using Cars.Models; 7 | 8 | using Telerik.JustMock; 9 | 10 | public class JustMockCarsRepository : CarRepositoryMock, ICarsRepositoryMock 11 | { 12 | protected override void ArrangeCarsRepositoryMock() 13 | { 14 | this.CarsData = Mock.Create(); 15 | Mock.Arrange(() => this.CarsData.Add(Arg.IsAny())).DoNothing(); 16 | Mock.Arrange(() => this.CarsData.All()).Returns(this.FakeCarCollection); 17 | Mock.Arrange(() => this.CarsData.Search(Arg.AnyString)).Returns(this.FakeCarCollection.Where(c => c.Make == "BMW").ToList()); 18 | Mock.Arrange(() => this.CarsData.GetById(Arg.AnyInt)).Returns(this.FakeCarCollection.First()); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Topics/03. Mocking and JustMock/demos/Cars-Example/Cars.Tests.JustMock/Mocks/MoqCarsRepository.cs: -------------------------------------------------------------------------------- 1 | namespace Cars.Tests.JustMock.Mocks 2 | { 3 | using Cars.Contracts; 4 | using Cars.Models; 5 | using Moq; 6 | using System.Linq; 7 | 8 | public class MoqCarsRepository : CarRepositoryMock, ICarsRepositoryMock 9 | { 10 | protected override void ArrangeCarsRepositoryMock() 11 | { 12 | var mockedCarsRepository = new Mock(); 13 | mockedCarsRepository.Setup(r => r.Add(It.IsAny())).Verifiable(); 14 | mockedCarsRepository.Setup(r => r.All()).Returns(this.FakeCarCollection); 15 | mockedCarsRepository.Setup(r => r.Search(It.IsAny())).Returns(this.FakeCarCollection.Where(c => c.Make == "BMW").ToList()); 16 | mockedCarsRepository.Setup(r => r.GetById(It.IsAny())).Returns(this.FakeCarCollection.First()); 17 | this.CarsData = mockedCarsRepository.Object; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Topics/03. Mocking and JustMock/demos/Cars-Example/Cars.Tests.JustMock/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /Topics/03. Mocking and JustMock/demos/Cars-Example/Cars.jmconfig: -------------------------------------------------------------------------------- 1 | false -------------------------------------------------------------------------------- /Topics/03. Mocking and JustMock/demos/Cars-Example/Cars/Contracts/ICarsRepository.cs: -------------------------------------------------------------------------------- 1 | namespace Cars.Contracts 2 | { 3 | using Cars.Models; 4 | using System.Collections.Generic; 5 | 6 | public interface ICarsRepository 7 | { 8 | int TotalCars{get;} 9 | 10 | void Add(Car car); 11 | 12 | void Remove(Car car); 13 | 14 | Car GetById(int id); 15 | 16 | ICollection All(); 17 | 18 | ICollection SortedByMake(); 19 | 20 | ICollection SortedByYear(); 21 | 22 | ICollection Search(string condition); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Topics/03. Mocking and JustMock/demos/Cars-Example/Cars/Contracts/IDatabase.cs: -------------------------------------------------------------------------------- 1 | namespace Cars.Contracts 2 | { 3 | using Cars.Models; 4 | using System.Collections.Generic; 5 | 6 | public interface IDatabase 7 | { 8 | IList Cars { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Topics/03. Mocking and JustMock/demos/Cars-Example/Cars/Contracts/IView.cs: -------------------------------------------------------------------------------- 1 | namespace Cars.Contracts 2 | { 3 | public interface IView 4 | { 5 | object Model { get; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Topics/03. Mocking and JustMock/demos/Cars-Example/Cars/Data/Database.cs: -------------------------------------------------------------------------------- 1 | namespace Cars.Data 2 | { 3 | using System.Collections.Generic; 4 | 5 | using Cars.Contracts; 6 | using Cars.Models; 7 | 8 | public class Database : IDatabase 9 | { 10 | public IList Cars { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Topics/03. Mocking and JustMock/demos/Cars-Example/Cars/Infrastructure/View.cs: -------------------------------------------------------------------------------- 1 | namespace Cars.Infrastructure 2 | { 3 | using Cars.Contracts; 4 | 5 | public class View : IView 6 | { 7 | public View(object model = null) 8 | { 9 | this.Model = model; 10 | } 11 | 12 | public object Model { get; private set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Topics/03. Mocking and JustMock/demos/Cars-Example/Cars/Models/Car.cs: -------------------------------------------------------------------------------- 1 | namespace Cars.Models 2 | { 3 | public class Car 4 | { 5 | public int Id { get; set; } 6 | 7 | public string Make { get; set; } 8 | 9 | public string Model { get; set; } 10 | 11 | public int Year { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Topics/03. Mocking and JustMock/demos/Cars-Example/README.txt: -------------------------------------------------------------------------------- 1 | Install JustMock trial and reference it to the tests project 2 | http://www.telerik.com/products/mocking.aspx -------------------------------------------------------------------------------- /Topics/03. Mocking and JustMock/demos/TaskManager-Example/Tasker.Tests/Core/Providers/IdProviderTests.cs: -------------------------------------------------------------------------------- 1 | using NUnit.Framework; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using Tasker.Core.Providers; 8 | 9 | namespace Tasker.Tests.Core.Providers 10 | { 11 | [TestFixture] 12 | public class IdProviderTests 13 | { 14 | [Test] 15 | public void NextId_ShouldReturnIncrementedValue_WhenInvoced() 16 | { 17 | var sut = new IdProvider(); 18 | 19 | var resultOne = sut.NextId(); 20 | var resultTwo = sut.NextId(); 21 | 22 | Assert.AreEqual(0, resultOne); 23 | Assert.AreEqual(1, resultTwo); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Topics/03. Mocking and JustMock/demos/TaskManager-Example/Tasker.Tests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Topics/03. Mocking and JustMock/demos/TaskManager-Example/Tasker/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Topics/03. Mocking and JustMock/demos/TaskManager-Example/Tasker/Core/Contracts/IIdProvider.cs: -------------------------------------------------------------------------------- 1 | namespace Tasker.Core.Contracts 2 | { 3 | public interface IIdProvider 4 | { 5 | int NextId(); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Topics/03. Mocking and JustMock/demos/TaskManager-Example/Tasker/Core/Contracts/ILogger.cs: -------------------------------------------------------------------------------- 1 | namespace Tasker.Core.Contracts 2 | { 3 | public interface ILogger 4 | { 5 | void Log(string message); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Topics/03. Mocking and JustMock/demos/TaskManager-Example/Tasker/Core/Contracts/ITaskManager.cs: -------------------------------------------------------------------------------- 1 | using Tasker.Models.Contracts; 2 | 3 | namespace Tasker.Core.Contracts 4 | { 5 | public interface ITaskManager 6 | { 7 | void Add(ITask task); 8 | 9 | void Remove(int id); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Topics/03. Mocking and JustMock/demos/TaskManager-Example/Tasker/Core/Providers/ConsoleLogger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Tasker.Core.Contracts; 7 | 8 | namespace Tasker.Core.Providers 9 | { 10 | class ConsoleLogger : ILogger 11 | { 12 | public void Log(string message) 13 | { 14 | Console.WriteLine(message); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Topics/03. Mocking and JustMock/demos/TaskManager-Example/Tasker/Core/Providers/IdProvider.cs: -------------------------------------------------------------------------------- 1 | using Tasker.Core.Contracts; 2 | 3 | namespace Tasker.Core.Providers 4 | { 5 | public class IdProvider : IIdProvider 6 | { 7 | private static int currentId = 0; 8 | 9 | public int NextId() 10 | { 11 | return currentId++; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Topics/03. Mocking and JustMock/demos/TaskManager-Example/Tasker/Models/Contracts/ITask.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Tasker.Models.Contracts 8 | { 9 | public interface ITask 10 | { 11 | int Id { get; set; } 12 | 13 | string Description { get; set; } 14 | 15 | bool IsDone { get; set; } 16 | 17 | DateTime? DueDate { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Topics/03. Mocking and JustMock/demos/TaskManager-Example/Tasker/Models/Task.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Tasker.Models.Contracts; 3 | 4 | namespace Tasker.Models 5 | { 6 | public class Task : ITask 7 | { 8 | public Task(string description) 9 | { 10 | this.Description = description; 11 | this.IsDone = false; 12 | } 13 | 14 | public int Id { get; set; } 15 | 16 | public string Description { get; set; } 17 | 18 | public bool IsDone { get; set; } 19 | 20 | public DateTime? DueDate { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Topics/03. Mocking and JustMock/demos/TaskManager-Example/Tasker/Program.cs: -------------------------------------------------------------------------------- 1 | using Tasker.Core; 2 | using Tasker.Core.Providers; 3 | using Tasker.Models; 4 | 5 | namespace Tasker 6 | { 7 | public class Startup 8 | { 9 | public static void Main() 10 | { 11 | var idProvider = new IdProvider(); 12 | var consoleLogger = new ConsoleLogger(); 13 | 14 | var manager = new TaskManager(idProvider, consoleLogger); 15 | var task = new Task("Some task"); 16 | 17 | manager.Add(task); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Topics/03. Mocking and JustMock/homework/README.md: -------------------------------------------------------------------------------- 1 | # Homework 2 | 3 | ### Finish the unit testing for `CarsController` 4 | 5 | * Write mocks for the rest of `ICarsRepository` interface (sorting) 6 | * Write missing unit test so that the controller functionality is fully tested 7 | -------------------------------------------------------------------------------- /Topics/03. Mocking and JustMock/imgs/pic00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/03. Mocking and JustMock/imgs/pic00.png -------------------------------------------------------------------------------- /Topics/03. Mocking and JustMock/imgs/pic01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/03. Mocking and JustMock/imgs/pic01.png -------------------------------------------------------------------------------- /Topics/03. Mocking and JustMock/imgs/pic02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/03. Mocking and JustMock/imgs/pic02.png -------------------------------------------------------------------------------- /Topics/03. Mocking and JustMock/imgs/pic03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/03. Mocking and JustMock/imgs/pic03.png -------------------------------------------------------------------------------- /Topics/03. Mocking and JustMock/imgs/pic04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/03. Mocking and JustMock/imgs/pic04.png -------------------------------------------------------------------------------- /Topics/03. Mocking and JustMock/imgs/pic05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/03. Mocking and JustMock/imgs/pic05.png -------------------------------------------------------------------------------- /Topics/03. Mocking and JustMock/imgs/pic06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/03. Mocking and JustMock/imgs/pic06.png -------------------------------------------------------------------------------- /Topics/03. Mocking and JustMock/imgs/pic07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/03. Mocking and JustMock/imgs/pic07.png -------------------------------------------------------------------------------- /Topics/03. Mocking and JustMock/imgs/pic08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/03. Mocking and JustMock/imgs/pic08.png -------------------------------------------------------------------------------- /Topics/03. Mocking and JustMock/imgs/pic09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/03. Mocking and JustMock/imgs/pic09.png -------------------------------------------------------------------------------- /Topics/03. Mocking and JustMock/imgs/pic10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/03. Mocking and JustMock/imgs/pic10.png -------------------------------------------------------------------------------- /Topics/03. Mocking and JustMock/imgs/pic11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TelerikAcademy/Unit-Testing/04627095d8a82501654359120cc49c0cb32f0fb8/Topics/03. Mocking and JustMock/imgs/pic11.png -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Academy/Workshop/Academy.Tests/Commands/Mocks/AddStudentToSeasonCommandMock.cs: -------------------------------------------------------------------------------- 1 | using Academy.Commands.Adding; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using Academy.Core.Contracts; 8 | 9 | namespace Academy.Tests.Commands.Mocks 10 | { 11 | internal class AddStudentToSeasonCommandMock : AddStudentToSeasonCommand 12 | { 13 | internal AddStudentToSeasonCommandMock(IAcademyFactory factory, IEngine engine) 14 | : base(factory, engine) 15 | { 16 | } 17 | 18 | public IAcademyFactory AcademyFactory 19 | { 20 | get 21 | { 22 | return this.factory; 23 | } 24 | } 25 | 26 | public IEngine Engine 27 | { 28 | get 29 | { 30 | return this.engine; 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Academy/Workshop/Academy.Tests/Core/FactoriesTests/AcademyFactoryTests/CreateSeason_Should.cs: -------------------------------------------------------------------------------- 1 | using Academy.Core.Factories; 2 | using NUnit.Framework; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Academy.Tests.Core.FactoriesTests.AcademyFactoryTests 10 | { 11 | [TestFixture] 12 | public class CreateSeason_Should 13 | { 14 | [Test] 15 | public void ThrowException_WhenThePassedStringCouldNotBeParsed() 16 | { 17 | // Arrange 18 | var academyFactory = AcademyFactory.Instance; 19 | 20 | // Act & Assert 21 | Assert.Throws(()=>academyFactory.CreateSeason("2016", "2017", "20")); 22 | 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Academy/Workshop/Academy.Tests/Core/FactoriesTests/AcademyFactoryTests/Instance_Should.cs: -------------------------------------------------------------------------------- 1 | using Academy.Core.Contracts; 2 | using Academy.Core.Factories; 3 | using NUnit.Framework; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace Academy.Tests.Core.FactoriesTests.AcademyFactoryTests 11 | { 12 | [TestFixture] 13 | public class AcademyFactoryTests 14 | { 15 | [Test] 16 | public void ReturnIAcademyFactoryInstance_WhenCalled() 17 | { 18 | // Arrange & Act 19 | var academyFactory = AcademyFactory.Instance; 20 | 21 | // Assert 22 | Assert.IsInstanceOf(academyFactory); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Academy/Workshop/Academy.Tests/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Academy/Workshop/Academy.Tests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Academy/Workshop/Academy/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Academy/Workshop/Academy/Commands/Contracts/ICommand.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Academy.Commands.Contracts 4 | { 5 | public interface ICommand 6 | { 7 | /// 8 | /// Executes the command with the passed parameters. 9 | /// 10 | /// Parameters to execute the command with. 11 | /// Returns execution result message. 12 | string Execute(IList parameters); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Academy/Workshop/Academy/Core/Contracts/IEngine.cs: -------------------------------------------------------------------------------- 1 | using Academy.Models.Contracts; 2 | using System.Collections.Generic; 3 | 4 | namespace Academy.Core.Contracts 5 | { 6 | public interface IEngine 7 | { 8 | void Start(); 9 | 10 | IReader Reader { get; set; } 11 | 12 | IWriter Writer { get; set; } 13 | 14 | IParser Parser { get; set; } 15 | 16 | 17 | IList Seasons { get; } 18 | 19 | IList Students { get; } 20 | 21 | IList Trainers { get; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Academy/Workshop/Academy/Core/Contracts/IParser.cs: -------------------------------------------------------------------------------- 1 | using Academy.Commands.Contracts; 2 | using System.Collections.Generic; 3 | 4 | namespace Academy.Core.Contracts 5 | { 6 | public interface IParser 7 | { 8 | ICommand ParseCommand(string fullCommand); 9 | 10 | IList ParseParameters(string fullCommand); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Academy/Workshop/Academy/Core/Contracts/IReader.cs: -------------------------------------------------------------------------------- 1 | namespace Academy.Core.Contracts 2 | { 3 | public interface IReader 4 | { 5 | string ReadLine(); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Academy/Workshop/Academy/Core/Contracts/IWriter.cs: -------------------------------------------------------------------------------- 1 | namespace Academy.Core.Contracts 2 | { 3 | public interface IWriter 4 | { 5 | void Write(string message); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Academy/Workshop/Academy/Core/Factories/IAcademyFactory.cs: -------------------------------------------------------------------------------- 1 | using Academy.Models.Contracts; 2 | using Academy.Models.Utils.Contracts; 3 | using System; 4 | 5 | namespace Academy.Core.Contracts 6 | { 7 | public interface IAcademyFactory 8 | { 9 | ISeason CreateSeason(string startingYear, string endingYear, string initiative); 10 | 11 | IStudent CreateStudent(string username, string track); 12 | 13 | ITrainer CreateTrainer(string username, string technologies); 14 | 15 | ICourse CreateCourse(string name, string lecturesPerWeek, string startingDate); 16 | 17 | ILecture CreateLecture(string name, string date, ITrainer trainer); 18 | 19 | ILectureResource CreateLectureResource(string type, string name, string url); 20 | 21 | ICourseResult CreateCourseResult(ICourse course, string examPoints, string coursePoints); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Academy/Workshop/Academy/Core/Providers/ConsoleReader.cs: -------------------------------------------------------------------------------- 1 | using Academy.Core.Contracts; 2 | using System; 3 | 4 | namespace Academy.Core.Providers 5 | { 6 | public class ConsoleReader : IReader 7 | { 8 | public string ReadLine() 9 | { 10 | return Console.ReadLine(); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Academy/Workshop/Academy/Core/Providers/ConsoleWriter.cs: -------------------------------------------------------------------------------- 1 | using Academy.Core.Contracts; 2 | using System; 3 | 4 | namespace Academy.Core.Providers 5 | { 6 | public class ConsoleWriter : IWriter 7 | { 8 | public void Write(string message) 9 | { 10 | Console.Write(message); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Academy/Workshop/Academy/Core/Providers/DateTimeProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Academy.Core.Providers 4 | { 5 | internal abstract class DateTimeProvider 6 | { 7 | public static DateTime Now 8 | { 9 | get 10 | { 11 | return new DateTime(2017, 1, 16, 0, 0, 0); 12 | } 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Academy/Workshop/Academy/Models/Abstractions/User.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Academy.Models.Abstractions 4 | { 5 | public abstract class User : IUser 6 | { 7 | private string username; 8 | 9 | protected User(string username) 10 | { 11 | this.Username = username; 12 | } 13 | 14 | public string Username 15 | { 16 | get 17 | { 18 | return this.username; 19 | } 20 | set 21 | { 22 | if (string.IsNullOrWhiteSpace(value) 23 | || value.Length < 3 24 | || value.Length > 16) 25 | { 26 | throw new ArgumentException("User's username should be between 3 and 16 symbols long!"); 27 | } 28 | 29 | this.username = value; 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Academy/Workshop/Academy/Models/Contracts/ICourse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace Academy.Models.Contracts 5 | { 6 | public interface ICourse 7 | { 8 | string Name { get; set; } 9 | 10 | int LecturesPerWeek { get; set; } 11 | 12 | DateTime? StartingDate { get; set; } 13 | 14 | DateTime? EndingDate { get; set; } 15 | 16 | IList OnsiteStudents { get; } 17 | 18 | IList OnlineStudents { get; } 19 | 20 | IList Lectures { get; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Academy/Workshop/Academy/Models/Contracts/ILecture.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace Academy.Models.Contracts 5 | { 6 | public interface ILecture 7 | { 8 | string Name { get; set; } 9 | 10 | DateTime Date { get; set; } 11 | 12 | ITrainer Trainer { get; set; } 13 | 14 | IList Resources { get; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Academy/Workshop/Academy/Models/Contracts/ISeason.cs: -------------------------------------------------------------------------------- 1 | using Academy.Models.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | 5 | namespace Academy.Models.Contracts 6 | { 7 | public interface ISeason 8 | { 9 | Initiative Initiative { get; set; } 10 | 11 | int StartingYear { get; set; } 12 | 13 | int EndingYear { get; set; } 14 | 15 | IList Students { get; set; } 16 | 17 | IList Trainers { get; set; } 18 | 19 | IList Courses { get; set; } 20 | 21 | string ListUsers(); 22 | 23 | string ListCourses(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Academy/Workshop/Academy/Models/Contracts/IStudent.cs: -------------------------------------------------------------------------------- 1 | using Academy.Models.Enums; 2 | using Academy.Models.Utils.Contracts; 3 | using System.Collections.Generic; 4 | 5 | namespace Academy.Models.Contracts 6 | { 7 | public interface IStudent : IUser 8 | { 9 | Track Track { get; set; } 10 | 11 | IList CourseResults { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Academy/Workshop/Academy/Models/Contracts/ITrainer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Academy.Models.Contracts 4 | { 5 | public interface ITrainer : IUser 6 | { 7 | IList Technologies { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Academy/Workshop/Academy/Models/Contracts/IUser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Academy.Models 4 | { 5 | public interface IUser 6 | { 7 | string Username { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Academy/Workshop/Academy/Models/Enums/Grade.cs: -------------------------------------------------------------------------------- 1 | namespace Academy.Models.Enums 2 | { 3 | public enum Grade 4 | { 5 | Excellent = 0, 6 | Passed = 1, 7 | Failed = 2 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Academy/Workshop/Academy/Models/Enums/Initiative.cs: -------------------------------------------------------------------------------- 1 | namespace Academy.Models.Enums 2 | { 3 | public enum Initiative 4 | { 5 | SoftwareAcademy = 0, 6 | SchoolAcademy = 1, 7 | KidsAcademy = 2, 8 | CoderDojo = 3 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Academy/Workshop/Academy/Models/Enums/Track.cs: -------------------------------------------------------------------------------- 1 | namespace Academy.Models.Enums 2 | { 3 | public enum Track 4 | { 5 | Frontend = 0, 6 | Dev = 1, 7 | None = 2 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Academy/Workshop/Academy/Models/Trainer.cs: -------------------------------------------------------------------------------- 1 | using Academy.Models.Abstractions; 2 | using Academy.Models.Contracts; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Academy.Models 7 | { 8 | public class Trainer : User, ITrainer 9 | { 10 | public Trainer(string username, IList technologies) : base(username) 11 | { 12 | this.Technologies = technologies; 13 | } 14 | 15 | public IList Technologies { get; set; } 16 | 17 | public override string ToString() 18 | { 19 | var builder = new StringBuilder(); 20 | builder.AppendLine("* Trainer:"); 21 | builder.AppendLine($" - Username: {this.Username}"); 22 | builder.AppendLine($" - Technologies: {string.Join("; ", this.Technologies)}"); 23 | 24 | return builder.ToString().TrimEnd(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Academy/Workshop/Academy/Models/Utils/Contracts/ICourseResult.cs: -------------------------------------------------------------------------------- 1 | using Academy.Models.Contracts; 2 | using Academy.Models.Enums; 3 | 4 | namespace Academy.Models.Utils.Contracts 5 | { 6 | public interface ICourseResult 7 | { 8 | ICourse Course { get; } 9 | 10 | float ExamPoints { get; } 11 | 12 | float CoursePoints { get; } 13 | 14 | Grade Grade { get; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Academy/Workshop/Academy/Models/Utils/Contracts/ILectureResource.cs: -------------------------------------------------------------------------------- 1 | namespace Academy.Models.Contracts 2 | { 3 | public interface ILectureResource 4 | { 5 | string Name { get; set; } 6 | 7 | string Url { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Academy/Workshop/Academy/Models/Utils/LectureResources/DemoResource.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | 4 | namespace Academy.Models.Utils.LectureResources 5 | { 6 | public class DemoResource : Resource 7 | { 8 | public DemoResource(string name, string url) : base(name, url) 9 | { 10 | } 11 | 12 | public override string ToString() 13 | { 14 | var builder = new StringBuilder(); 15 | builder.AppendLine($" - Type: Demo"); 16 | return base.ToString() + builder.ToString().TrimEnd(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Academy/Workshop/Academy/Models/Utils/LectureResources/HomeworkResource.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | 4 | namespace Academy.Models.Utils.LectureResources 5 | { 6 | public class HomeworkResource : Resource 7 | { 8 | public HomeworkResource(string name, string url, DateTime dueDate) : base(name, url) 9 | { 10 | this.DueDate = dueDate; 11 | } 12 | 13 | public DateTime DueDate { get; set; } 14 | 15 | public override string ToString() 16 | { 17 | var builder = new StringBuilder(); 18 | builder.AppendLine($" - Type: Homework"); 19 | builder.AppendLine($" - Due date: {this.DueDate}"); 20 | return base.ToString() + builder.ToString().TrimEnd(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Academy/Workshop/Academy/Models/Utils/LectureResources/PresentationResource.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | 4 | namespace Academy.Models.Utils.LectureResources 5 | { 6 | public class PresentationResource : Resource 7 | { 8 | public PresentationResource(string name, string url) : base(name, url) 9 | { 10 | } 11 | 12 | public override string ToString() 13 | { 14 | var builder = new StringBuilder(); 15 | builder.AppendLine($" - Type: Presentation"); 16 | return base.ToString() + builder.ToString().TrimEnd(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Academy/Workshop/Academy/Models/Utils/LectureResources/VideoResource.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | 4 | namespace Academy.Models.Utils.LectureResources 5 | { 6 | public class VideoResource : Resource 7 | { 8 | public VideoResource(string name, string url, DateTime uploaded) : base(name, url) 9 | { 10 | this.UploadedOn = uploaded; 11 | } 12 | 13 | public DateTime UploadedOn { get; set; } 14 | 15 | public override string ToString() 16 | { 17 | var builder = new StringBuilder(); 18 | builder.AppendLine($" - Type: Video"); 19 | builder.AppendLine($" - Uploaded on: {this.UploadedOn}"); 20 | return base.ToString() + builder.ToString().TrimEnd(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Academy/Workshop/Academy/Startup.cs: -------------------------------------------------------------------------------- 1 | using Academy.Core; 2 | 3 | namespace Academy 4 | { 5 | public class Startup 6 | { 7 | public static void Main(string[] args) 8 | { 9 | // Singleton design pattern 10 | // Ensures that there is only one instance of Engine in existance 11 | var engine = Engine.Instance; 12 | engine.Start(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Cosmetics/Solution/Cosmetics.Tests/Engine/Mocks/MockedCosmeticsEngine.cs: -------------------------------------------------------------------------------- 1 | namespace Cosmetics.Tests.Engine.Mocks 2 | { 3 | using System.Collections.Generic; 4 | 5 | using Cosmetics.Contracts; 6 | using Cosmetics.Engine; 7 | 8 | internal class MockedCosmeticsEngine : CosmeticsEngine 9 | { 10 | public MockedCosmeticsEngine(ICosmeticsFactory factory, IShoppingCart shoppingCart, ICommandParser commandParser) : base(factory, shoppingCart, commandParser) 11 | { 12 | } 13 | 14 | public IDictionary Categories 15 | { 16 | get 17 | { 18 | return base.categories; 19 | } 20 | } 21 | 22 | public IDictionary Products 23 | { 24 | get 25 | { 26 | return base.products; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Cosmetics/Solution/Cosmetics.Tests/Products/Mocks/MockedCategory.cs: -------------------------------------------------------------------------------- 1 | namespace Cosmetics.Tests.Products.Mocks 2 | { 3 | using System.Collections.Generic; 4 | 5 | using Cosmetics.Contracts; 6 | using Cosmetics.Products; 7 | 8 | internal class MockedCategory : Category 9 | { 10 | public MockedCategory(string name) : base(name) 11 | { 12 | } 13 | 14 | public IList Products 15 | { 16 | get 17 | { 18 | return base.products; 19 | } 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Cosmetics/Solution/Cosmetics.Tests/Products/Mocks/MockedShoppingCart.cs: -------------------------------------------------------------------------------- 1 | namespace Cosmetics.Tests.Products.Mocks 2 | { 3 | using System.Collections.Generic; 4 | 5 | using Cosmetics.Contracts; 6 | using Cosmetics.Products; 7 | 8 | internal class MockedShoppingCart : ShoppingCart 9 | { 10 | public IList Products 11 | { 12 | get 13 | { 14 | return base.products; 15 | } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Cosmetics/Solution/Cosmetics.Tests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Cosmetics/Solution/Cosmetics/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Cosmetics/Solution/Cosmetics/Common/GenderType.cs: -------------------------------------------------------------------------------- 1 | namespace Cosmetics.Common 2 | { 3 | public enum GenderType 4 | { 5 | Men, 6 | Women, 7 | Unisex 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Cosmetics/Solution/Cosmetics/Common/GlobalErrorMessages.cs: -------------------------------------------------------------------------------- 1 | namespace Cosmetics.Common 2 | { 3 | public class GlobalErrorMessages 4 | { 5 | public const string StringCannotBeNullOrEmpty = "{0} cannot be null or empty!"; 6 | public const string ObjectCannotBeNull = "{0} cannot be null!"; 7 | public const string InvalidStringLength = "{0} must be between {1} and {2} symbols long!"; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Cosmetics/Solution/Cosmetics/Common/UsageType.cs: -------------------------------------------------------------------------------- 1 | namespace Cosmetics.Common 2 | { 3 | public enum UsageType 4 | { 5 | EveryDay, 6 | Medical 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Cosmetics/Solution/Cosmetics/Common/Validator.cs: -------------------------------------------------------------------------------- 1 | namespace Cosmetics.Common 2 | { 3 | using System; 4 | 5 | public static class Validator 6 | { 7 | public static void CheckIfNull(object obj, string message = null) 8 | { 9 | if (obj == null) 10 | { 11 | throw new NullReferenceException(message); 12 | } 13 | } 14 | 15 | public static void CheckIfStringIsNullOrEmpty(string text, string message = null) 16 | { 17 | if (string.IsNullOrEmpty(text)) 18 | { 19 | throw new NullReferenceException(message); 20 | } 21 | } 22 | 23 | public static void CheckIfStringLengthIsValid(string text, int max, int min = 0, string message = null) 24 | { 25 | if (text.Length < min || max < text.Length) 26 | { 27 | throw new IndexOutOfRangeException(message); 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Cosmetics/Solution/Cosmetics/Contracts/ICategory.cs: -------------------------------------------------------------------------------- 1 | namespace Cosmetics.Contracts 2 | { 3 | internal interface ICategory 4 | { 5 | string Name { get; } 6 | 7 | void AddProduct(IProduct cosmetics); 8 | 9 | void RemoveProduct(IProduct cosmetics); 10 | 11 | string Print(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Cosmetics/Solution/Cosmetics/Contracts/ICommand.cs: -------------------------------------------------------------------------------- 1 | namespace Cosmetics.Contracts 2 | { 3 | using System.Collections.Generic; 4 | 5 | internal interface ICommand 6 | { 7 | string Name { get; } 8 | 9 | IList Parameters { get; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Cosmetics/Solution/Cosmetics/Contracts/ICommandParser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Cosmetics.Contracts 8 | { 9 | internal interface ICommandParser 10 | { 11 | IList ReadCommands(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Cosmetics/Solution/Cosmetics/Contracts/ICosmeticsFactory.cs: -------------------------------------------------------------------------------- 1 | namespace Cosmetics.Contracts 2 | { 3 | using System.Collections.Generic; 4 | 5 | using Cosmetics.Common; 6 | 7 | internal interface ICosmeticsFactory 8 | { 9 | ICategory CreateCategory(string name); 10 | 11 | IShampoo CreateShampoo(string name, string brand, decimal price, GenderType gender, uint milliliters, UsageType usage); 12 | 13 | IToothpaste CreateToothpaste(string name, string brand, decimal price, GenderType gender, IList ingredients); 14 | 15 | IShoppingCart CreateShoppingCart(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Cosmetics/Solution/Cosmetics/Contracts/IEngine.cs: -------------------------------------------------------------------------------- 1 | namespace Cosmetics.Contracts 2 | { 3 | internal interface IEngine 4 | { 5 | void Start(); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Cosmetics/Solution/Cosmetics/Contracts/IProduct.cs: -------------------------------------------------------------------------------- 1 | namespace Cosmetics.Contracts 2 | { 3 | using Cosmetics.Common; 4 | 5 | internal interface IProduct 6 | { 7 | string Name { get; } 8 | 9 | string Brand { get; } 10 | 11 | decimal Price { get; } 12 | 13 | GenderType Gender { get; } 14 | 15 | string Print(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Cosmetics/Solution/Cosmetics/Contracts/IShampoo.cs: -------------------------------------------------------------------------------- 1 | namespace Cosmetics.Contracts 2 | { 3 | using Cosmetics.Common; 4 | 5 | internal interface IShampoo : IProduct 6 | { 7 | uint Milliliters { get; } 8 | 9 | UsageType Usage { get; } 10 | } 11 | } -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Cosmetics/Solution/Cosmetics/Contracts/IShoppingCart.cs: -------------------------------------------------------------------------------- 1 | namespace Cosmetics.Contracts 2 | { 3 | internal interface IShoppingCart 4 | { 5 | void AddProduct(IProduct product); 6 | 7 | void RemoveProduct(IProduct product); 8 | 9 | bool ContainsProduct(IProduct product); 10 | 11 | decimal TotalPrice(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Cosmetics/Solution/Cosmetics/Contracts/IToothpaste.cs: -------------------------------------------------------------------------------- 1 | namespace Cosmetics.Contracts 2 | { 3 | using System.Collections.Generic; 4 | 5 | internal interface IToothpaste : IProduct 6 | { 7 | string Ingredients { get; } 8 | } 9 | } -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Cosmetics/Solution/Cosmetics/CosmeticsProgram.cs: -------------------------------------------------------------------------------- 1 | using Cosmetics.Engine; 2 | using Cosmetics.Products; 3 | 4 | namespace Cosmetics 5 | { 6 | public class CosmeticsProgram 7 | { 8 | public static void Main() 9 | { 10 | var factory = new CosmeticsFactory(); 11 | var shoppingCart = new ShoppingCart(); 12 | var consoleCommandParser = new ConsoleCommandParser(); 13 | var engine = new CosmeticsEngine(factory, shoppingCart, consoleCommandParser); 14 | 15 | engine.Start(); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Cosmetics/Solution/Cosmetics/Engine/ConsoleCommandParser.cs: -------------------------------------------------------------------------------- 1 | using Cosmetics.Contracts; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Cosmetics.Engine 9 | { 10 | internal class ConsoleCommandParser : ICommandParser 11 | { 12 | public IList ReadCommands() 13 | { 14 | var commands = new List(); 15 | 16 | var currentLine = Console.ReadLine(); 17 | 18 | while (!string.IsNullOrEmpty(currentLine)) 19 | { 20 | var currentCommand = Command.Parse(currentLine); 21 | commands.Add(currentCommand); 22 | 23 | currentLine = Console.ReadLine(); 24 | } 25 | 26 | return commands; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Cosmetics/Tests/test.001.in.txt: -------------------------------------------------------------------------------- 1 | CreateCategory ForMale 2 | ShowCategory ForMale 3 | CreateCategory a 4 | CreateCategory qwertyuiopasdfghjklzxcvbnm 5 | CreateCategory ForMale -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Cosmetics/Tests/test.001.out.txt: -------------------------------------------------------------------------------- 1 | Category with name ForMale was created! 2 | ForMale category - 0 products in total 3 | Category name must be between 2 and 15 symbols long! 4 | Category name must be between 2 and 15 symbols long! 5 | Category with name ForMale already exists! 6 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Cosmetics/Tests/test.002.in.txt: -------------------------------------------------------------------------------- 1 | CreateShampoo Cool Nivea 0.50 men 500 everyday 2 | CreateShampoo C Nivea 0.50 men 500 everyday 3 | CreateShampoo CoolCoolCoolCool Nivea 0.50 men 500 everyday 4 | CreateShampoo Cool N 0.50 men 500 everyday 5 | CreateShampoo CoolAgain N 0.50 men 500 everyday 6 | CreateShampoo CoolAgaina Nnnnnnnnnnnnnnnnnnnnnnnn 0.50 men 500 everyday 7 | CreateShampoo Cool Nivea 0.50 men 500 everyday 8 | CreateShampoo C Nivea 0.50 men 500 everyday 9 | CreateShampoo CoolCoolCoolCool Nivea 0.50 men 500 everyday 10 | CreateShampoo Cool N 0.50 men 500 everyday 11 | CreateShampoo CoolAgain N 0.50 men 500 everyday 12 | CreateShampoo CoolAgaina Nnnnnnnnnnnnnnnnnnnnnnnn 0.50 men 500 everyday 13 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Cosmetics/Tests/test.002.out.txt: -------------------------------------------------------------------------------- 1 | Shampoo with name Cool was created! 2 | Product name must be between 3 and 10 symbols long! 3 | Product name must be between 3 and 10 symbols long! 4 | Shampoo with name Cool already exists! 5 | Product brand must be between 2 and 10 symbols long! 6 | Product brand must be between 2 and 10 symbols long! 7 | Shampoo with name Cool already exists! 8 | Product name must be between 3 and 10 symbols long! 9 | Product name must be between 3 and 10 symbols long! 10 | Shampoo with name Cool already exists! 11 | Product brand must be between 2 and 10 symbols long! 12 | Product brand must be between 2 and 10 symbols long! 13 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Cosmetics/Tests/test.003.in.txt: -------------------------------------------------------------------------------- 1 | CreateToothpaste White+ Colgate 15.50 men fluor,bqla,golqma 2 | CreateToothpaste W Colgate 15.50 men fluor,bqla,golqma 3 | CreateToothpaste White+White+White+White+White+ Colgate 15.50 men fluor,bqla,golqma 4 | CreateToothpaste White+ Colgate 15.50 men fluor,bqla,golqma 5 | CreateToothpaste White+++ C 15.50 men fluor,bqla,golqma 6 | CreateToothpaste White++++ ColgateColgateColgateColgate 15.50 men fluor,bqla,golqma 7 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Cosmetics/Tests/test.003.out.txt: -------------------------------------------------------------------------------- 1 | Toothpaste with name White+ was created! 2 | Product name must be between 3 and 10 symbols long! 3 | Product name must be between 3 and 10 symbols long! 4 | Toothpaste with name White+ already exists! 5 | Product brand must be between 2 and 10 symbols long! 6 | Product brand must be between 2 and 10 symbols long! 7 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Cosmetics/Tests/test.004.in.txt: -------------------------------------------------------------------------------- 1 | CreateCategory ForMale 2 | ShowCategory ForMale 3 | CreateShampoo Cool Nivea 0.50 men 500 everyday 4 | CreateToothpaste White+ Colgate 15.50 men fluor,bqla,golqma 5 | AddToCategory ForMale Cool 6 | ShowCategory ForMale 7 | AddToCategory ForMale White+ 8 | ShowCategory ForMale 9 | CreateToothpaste White- Colgate 19.50 men fluor,bqla,golqma 10 | AddToCategory ForMale White- 11 | ShowCategory ForMale 12 | RemoveFromCategory ForMale Cool 13 | ShowCategory ForMale 14 | RemoveFromCategory ForMale White+ 15 | ShowCategory ForMale 16 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Cosmetics/Tests/test.005.in.txt: -------------------------------------------------------------------------------- 1 | CreateCategory ForMale 2 | ShowCategory ForMale 3 | CreateShampoo Cool Nivea 0.50 men 500 everyday 4 | CreateToothpaste White+ Colgate 15.50 men fluor,bqla,golqma 5 | AddToCategory ForMale Cool 6 | ShowCategory ForMale 7 | AddToCategory ForMale White+ 8 | ShowCategory ForMale 9 | CreateToothpaste White- Colgate 19.50 men fluor,bqla,golqma 10 | AddToCategory ForMale White- 11 | ShowCategory ForMale 12 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Cosmetics/Tests/test.006.in.txt: -------------------------------------------------------------------------------- 1 | CreateToothpaste White+ Colgate 15.50 men fluor,bqla,golqma 2 | AddToShoppingCart White+ 3 | CreateShampoo Cool Nivea 0.50 men 500 everyday 4 | AddToShoppingCart Cool 5 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Cosmetics/Tests/test.006.out.txt: -------------------------------------------------------------------------------- 1 | Toothpaste with name White+ was created! 2 | Product White+ was added to the shopping cart! 3 | Shampoo with name Cool was created! 4 | Product Cool was added to the shopping cart! 5 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Cosmetics/Tests/test.007.in.txt: -------------------------------------------------------------------------------- 1 | CreateToothpaste White+ Colgate 15.50 men fluor,bqla,golqma 2 | AddToShoppingCart White+ 3 | CreateShampoo Cool Nivea 0.50 men 500 everyday 4 | RemoveFromShoppingCart Cool 5 | RemoveFromShoppingCart White+ 6 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Cosmetics/Tests/test.007.out.txt: -------------------------------------------------------------------------------- 1 | Toothpaste with name White+ was created! 2 | Product White+ was added to the shopping cart! 3 | Shampoo with name Cool was created! 4 | Shopping cart does not contain product with name Cool! 5 | Product White+ was removed from the shopping cart! -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Cosmetics/Tests/test.008.in.txt: -------------------------------------------------------------------------------- 1 | CreateToothpaste White+ Colgate 15.50 men fluor,bqla,golqma 2 | AddToShoppingCart White+ 3 | CreateShampoo Cool Nivea 0.50 men 500 everyday 4 | AddToShoppingCart Cool 5 | TotalPrice 6 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Students)/Cosmetics/Tests/test.008.out.txt: -------------------------------------------------------------------------------- 1 | Toothpaste with name White+ was created! 2 | Product White+ was added to the shopping cart! 3 | Shampoo with name Cool was created! 4 | Product Cool was added to the shopping cart! 5 | $265.50 total price currently in the shopping cart! 6 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Academy/Workshop/Academy.Tests/Commands/Adding/Mocks/AddingToSeasonCommandMock.cs: -------------------------------------------------------------------------------- 1 | using Academy.Commands.Adding; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using Academy.Core.Contracts; 8 | 9 | namespace Academy.Tests.Commands.Adding.Mocks 10 | { 11 | internal class AddStudentToSeasonCommandMock : AddStudentToSeasonCommand 12 | { 13 | public AddStudentToSeasonCommandMock(IAcademyFactory factory, IEngine engine) 14 | : base(factory, engine) 15 | { 16 | } 17 | 18 | public IAcademyFactory AcademyFactory 19 | { 20 | get 21 | { 22 | return this.factory; 23 | } 24 | } 25 | 26 | public IEngine Engine 27 | { 28 | get 29 | { 30 | return this.engine; 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Academy/Workshop/Academy.Tests/Models/Abstractions/Mocks/UserMock.cs: -------------------------------------------------------------------------------- 1 | using Academy.Models.Abstractions; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Academy.Tests.Models.Abstractions.Mocks 9 | { 10 | internal class UserMock : User 11 | { 12 | public UserMock(string username) : base(username) 13 | { 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Academy/Workshop/Academy.Tests/Models/Abstractions/UserTests/GetUsername_Should.cs: -------------------------------------------------------------------------------- 1 | using Academy.Models.Abstractions; 2 | using Academy.Tests.Models.Abstractions.Mocks; 3 | using NUnit.Framework; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace Academy.Tests.Models.Abstractions.UserTests 11 | { 12 | [TestFixture] 13 | public class GetUsername_Should 14 | { 15 | [Test] 16 | public void ReturnProperUsername_WhenTheGetMethodISCalled() 17 | { 18 | // Arrange 19 | var user = new UserMock("Pesho"); 20 | 21 | // Act 22 | var foundUsername = user.Username; 23 | 24 | // Assert 25 | Assert.AreEqual("Pesho", foundUsername); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Academy/Workshop/Academy.Tests/Models/CourseTests/GetName_Should.cs: -------------------------------------------------------------------------------- 1 | using Academy.Models; 2 | using NUnit.Framework; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Academy.Tests.Models.CourseTests 10 | { 11 | [TestFixture] 12 | public class GetName_Should 13 | { 14 | [Test] 15 | public void ReturnTheProperValue_WhenGetMethodIsCalled() 16 | { 17 | // Arrange 18 | var course = new Course("Valid name", 5, new DateTime(2017, 02, 10), new DateTime(2017, 03, 10)); 19 | 20 | // Act 21 | var result = course.Name; 22 | 23 | // Assert 24 | Assert.AreEqual("Valid name", result); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Academy/Workshop/Academy.Tests/Models/CourseTests/SetName_Should.cs: -------------------------------------------------------------------------------- 1 | using Academy.Models; 2 | using NUnit.Framework; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Academy.Tests.Models.CourseTests 10 | { 11 | [TestFixture] 12 | public class SetName_Should 13 | { 14 | [TestCase("i")] 15 | [TestCase("very very very very very very very very very very very very very very very very long string")] 16 | public void ThrowsArgumentException_WhenInvalidValueIsPassed(string name) 17 | { 18 | // Arrange 19 | var course = new Course("Valid name", 5, new DateTime(2017, 02, 10), new DateTime(2017, 03, 10)); 20 | 21 | // Act && Assert 22 | Assert.Throws(() => course.Name = name); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Academy/Workshop/Academy.Tests/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Academy/Workshop/Academy.Tests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Academy/Workshop/Academy/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Academy/Workshop/Academy/Commands/Contracts/ICommand.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Academy.Commands.Contracts 4 | { 5 | public interface ICommand 6 | { 7 | /// 8 | /// Executes the command with the passed parameters. 9 | /// 10 | /// Parameters to execute the command with. 11 | /// Returns execution result message. 12 | string Execute(IList parameters); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Academy/Workshop/Academy/Core/Contracts/IEngine.cs: -------------------------------------------------------------------------------- 1 | using Academy.Models.Contracts; 2 | using System.Collections.Generic; 3 | 4 | namespace Academy.Core.Contracts 5 | { 6 | public interface IEngine 7 | { 8 | void Start(); 9 | 10 | IReader Reader { get; set; } 11 | 12 | IWriter Writer { get; set; } 13 | 14 | IParser Parser { get; set; } 15 | 16 | 17 | IList Seasons { get; } 18 | 19 | IList Students { get; } 20 | 21 | IList Trainers { get; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Academy/Workshop/Academy/Core/Contracts/IParser.cs: -------------------------------------------------------------------------------- 1 | using Academy.Commands.Contracts; 2 | using System.Collections.Generic; 3 | 4 | namespace Academy.Core.Contracts 5 | { 6 | public interface IParser 7 | { 8 | ICommand ParseCommand(string fullCommand); 9 | 10 | IList ParseParameters(string fullCommand); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Academy/Workshop/Academy/Core/Contracts/IReader.cs: -------------------------------------------------------------------------------- 1 | namespace Academy.Core.Contracts 2 | { 3 | public interface IReader 4 | { 5 | string ReadLine(); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Academy/Workshop/Academy/Core/Contracts/IWriter.cs: -------------------------------------------------------------------------------- 1 | namespace Academy.Core.Contracts 2 | { 3 | public interface IWriter 4 | { 5 | void Write(string message); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Academy/Workshop/Academy/Core/Factories/IAcademyFactory.cs: -------------------------------------------------------------------------------- 1 | using Academy.Models.Contracts; 2 | using Academy.Models.Utils.Contracts; 3 | using System; 4 | 5 | namespace Academy.Core.Contracts 6 | { 7 | public interface IAcademyFactory 8 | { 9 | ISeason CreateSeason(string startingYear, string endingYear, string initiative); 10 | 11 | IStudent CreateStudent(string username, string track); 12 | 13 | ITrainer CreateTrainer(string username, string technologies); 14 | 15 | ICourse CreateCourse(string name, string lecturesPerWeek, string startingDate); 16 | 17 | ILecture CreateLecture(string name, string date, ITrainer trainer); 18 | 19 | ILectureResource CreateLectureResource(string type, string name, string url); 20 | 21 | ICourseResult CreateCourseResult(ICourse course, string examPoints, string coursePoints); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Academy/Workshop/Academy/Core/Providers/ConsoleReader.cs: -------------------------------------------------------------------------------- 1 | using Academy.Core.Contracts; 2 | using System; 3 | 4 | namespace Academy.Core.Providers 5 | { 6 | public class ConsoleReader : IReader 7 | { 8 | public string ReadLine() 9 | { 10 | return Console.ReadLine(); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Academy/Workshop/Academy/Core/Providers/ConsoleWriter.cs: -------------------------------------------------------------------------------- 1 | using Academy.Core.Contracts; 2 | using System; 3 | 4 | namespace Academy.Core.Providers 5 | { 6 | public class ConsoleWriter : IWriter 7 | { 8 | public void Write(string message) 9 | { 10 | Console.Write(message); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Academy/Workshop/Academy/Core/Providers/DateTimeProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Academy.Core.Providers 4 | { 5 | internal abstract class DateTimeProvider 6 | { 7 | public static DateTime Now 8 | { 9 | get 10 | { 11 | return new DateTime(2017, 1, 16, 0, 0, 0); 12 | } 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Academy/Workshop/Academy/Models/Abstractions/User.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Academy.Models.Abstractions 4 | { 5 | public abstract class User : IUser 6 | { 7 | private string username; 8 | 9 | protected User(string username) 10 | { 11 | this.Username = username; 12 | } 13 | 14 | public string Username 15 | { 16 | get 17 | { 18 | return this.username; 19 | } 20 | set 21 | { 22 | if (string.IsNullOrWhiteSpace(value) 23 | || value.Length < 3 24 | || value.Length > 16) 25 | { 26 | throw new ArgumentException("User's username should be between 3 and 16 symbols long!"); 27 | } 28 | 29 | this.username = value; 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Academy/Workshop/Academy/Models/Contracts/ICourse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace Academy.Models.Contracts 5 | { 6 | public interface ICourse 7 | { 8 | string Name { get; set; } 9 | 10 | int LecturesPerWeek { get; set; } 11 | 12 | DateTime StartingDate { get; set; } 13 | 14 | DateTime EndingDate { get; set; } 15 | 16 | IList OnsiteStudents { get; } 17 | 18 | IList OnlineStudents { get; } 19 | 20 | IList Lectures { get; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Academy/Workshop/Academy/Models/Contracts/ILecture.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace Academy.Models.Contracts 5 | { 6 | public interface ILecture 7 | { 8 | string Name { get; set; } 9 | 10 | DateTime Date { get; set; } 11 | 12 | ITrainer Trainer { get; set; } 13 | 14 | IList Resources { get; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Academy/Workshop/Academy/Models/Contracts/ISeason.cs: -------------------------------------------------------------------------------- 1 | using Academy.Models.Enums; 2 | using System; 3 | using System.Collections.Generic; 4 | 5 | namespace Academy.Models.Contracts 6 | { 7 | public interface ISeason 8 | { 9 | Initiative Initiative { get; set; } 10 | 11 | int StartingYear { get; set; } 12 | 13 | int EndingYear { get; set; } 14 | 15 | IList Students { get; set; } 16 | 17 | IList Trainers { get; set; } 18 | 19 | IList Courses { get; set; } 20 | 21 | string ListUsers(); 22 | 23 | string ListCourses(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Academy/Workshop/Academy/Models/Contracts/IStudent.cs: -------------------------------------------------------------------------------- 1 | using Academy.Models.Enums; 2 | using Academy.Models.Utils.Contracts; 3 | using System.Collections.Generic; 4 | 5 | namespace Academy.Models.Contracts 6 | { 7 | public interface IStudent : IUser 8 | { 9 | Track Track { get; set; } 10 | 11 | IList CourseResults { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Academy/Workshop/Academy/Models/Contracts/ITrainer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Academy.Models.Contracts 4 | { 5 | public interface ITrainer : IUser 6 | { 7 | IList Technologies { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Academy/Workshop/Academy/Models/Contracts/IUser.cs: -------------------------------------------------------------------------------- 1 | namespace Academy.Models 2 | { 3 | public interface IUser 4 | { 5 | string Username { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Academy/Workshop/Academy/Models/Enums/Grade.cs: -------------------------------------------------------------------------------- 1 | namespace Academy.Models.Enums 2 | { 3 | public enum Grade 4 | { 5 | Excellent = 0, 6 | Passed = 1, 7 | Failed = 2 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Academy/Workshop/Academy/Models/Enums/Initiative.cs: -------------------------------------------------------------------------------- 1 | namespace Academy.Models.Enums 2 | { 3 | public enum Initiative 4 | { 5 | SoftwareAcademy = 0, 6 | SchoolAcademy = 1, 7 | KidsAcademy = 2, 8 | CoderDojo = 3 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Academy/Workshop/Academy/Models/Enums/Track.cs: -------------------------------------------------------------------------------- 1 | namespace Academy.Models.Enums 2 | { 3 | public enum Track 4 | { 5 | Frontend = 0, 6 | Dev = 1, 7 | None = 2 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Academy/Workshop/Academy/Models/Trainer.cs: -------------------------------------------------------------------------------- 1 | using Academy.Models.Abstractions; 2 | using Academy.Models.Contracts; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Academy.Models 7 | { 8 | public class Trainer : User, ITrainer 9 | { 10 | public Trainer(string username, IList technologies) : base(username) 11 | { 12 | this.Technologies = technologies; 13 | } 14 | 15 | public IList Technologies { get; set; } 16 | 17 | public override string ToString() 18 | { 19 | var builder = new StringBuilder(); 20 | builder.AppendLine("* Trainer:"); 21 | builder.AppendLine($" - Username: {this.Username}"); 22 | builder.AppendLine($" - Technologies: {string.Join("; ", this.Technologies)}"); 23 | 24 | return builder.ToString().TrimEnd(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Academy/Workshop/Academy/Models/Utils/Contracts/ICourseResult.cs: -------------------------------------------------------------------------------- 1 | using Academy.Models.Contracts; 2 | using Academy.Models.Enums; 3 | 4 | namespace Academy.Models.Utils.Contracts 5 | { 6 | public interface ICourseResult 7 | { 8 | ICourse Course { get; } 9 | 10 | float ExamPoints { get; } 11 | 12 | float CoursePoints { get; } 13 | 14 | Grade Grade { get; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Academy/Workshop/Academy/Models/Utils/Contracts/ILectureResource.cs: -------------------------------------------------------------------------------- 1 | namespace Academy.Models.Contracts 2 | { 3 | public interface ILectureResource 4 | { 5 | string Name { get; set; } 6 | 7 | string Url { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Academy/Workshop/Academy/Models/Utils/LectureResources/DemoResource.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | 4 | namespace Academy.Models.Utils.LectureResources 5 | { 6 | public class DemoResource : Resource 7 | { 8 | public DemoResource(string name, string url) : base(name, url) 9 | { 10 | } 11 | 12 | public override string ToString() 13 | { 14 | var builder = new StringBuilder(); 15 | builder.AppendLine($" - Type: Demo"); 16 | return base.ToString() + builder.ToString().TrimEnd(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Academy/Workshop/Academy/Models/Utils/LectureResources/HomeworkResource.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | 4 | namespace Academy.Models.Utils.LectureResources 5 | { 6 | public class HomeworkResource : Resource 7 | { 8 | public HomeworkResource(string name, string url, DateTime dueDate) : base(name, url) 9 | { 10 | this.DueDate = dueDate; 11 | } 12 | 13 | public DateTime DueDate { get; set; } 14 | 15 | public override string ToString() 16 | { 17 | var builder = new StringBuilder(); 18 | builder.AppendLine($" - Type: Homework"); 19 | builder.AppendLine($" - Due date: {this.DueDate}"); 20 | return base.ToString() + builder.ToString().TrimEnd(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Academy/Workshop/Academy/Models/Utils/LectureResources/PresentationResource.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | 4 | namespace Academy.Models.Utils.LectureResources 5 | { 6 | public class PresentationResource : Resource 7 | { 8 | public PresentationResource(string name, string url) : base(name, url) 9 | { 10 | } 11 | 12 | public override string ToString() 13 | { 14 | var builder = new StringBuilder(); 15 | builder.AppendLine($" - Type: Presentation"); 16 | return base.ToString() + builder.ToString().TrimEnd(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Academy/Workshop/Academy/Models/Utils/LectureResources/VideoResource.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | 4 | namespace Academy.Models.Utils.LectureResources 5 | { 6 | public class VideoResource : Resource 7 | { 8 | public VideoResource(string name, string url, DateTime uploaded) : base(name, url) 9 | { 10 | this.UploadedOn = uploaded; 11 | } 12 | 13 | public DateTime UploadedOn { get; set; } 14 | 15 | public override string ToString() 16 | { 17 | var builder = new StringBuilder(); 18 | builder.AppendLine($" - Type: Video"); 19 | builder.AppendLine($" - Uploaded on: {this.UploadedOn}"); 20 | return base.ToString() + builder.ToString().TrimEnd(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Academy/Workshop/Academy/Startup.cs: -------------------------------------------------------------------------------- 1 | using Academy.Core; 2 | 3 | namespace Academy 4 | { 5 | public class Startup 6 | { 7 | public static void Main(string[] args) 8 | { 9 | // Singleton design pattern 10 | // Ensures that there is only one instance of Engine in existance 11 | var engine = Engine.Instance; 12 | engine.Start(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/TestTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace ArmyOfCreatures.Tests 8 | { 9 | class TestTest 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures.Tests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/ExitCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | using ArmyOfCreatures.Logic.Battles; 4 | 5 | namespace ArmyOfCreatures.Console.Commands 6 | { 7 | public class ExitCommand : ICommand 8 | { 9 | public void ProcessCommand(IBattleManager battleManager, params string[] arguments) 10 | { 11 | Environment.Exit(0); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/ICommand.cs: -------------------------------------------------------------------------------- 1 | using ArmyOfCreatures.Logic.Battles; 2 | 3 | namespace ArmyOfCreatures.Console.Commands 4 | { 5 | public interface ICommand 6 | { 7 | void ProcessCommand(IBattleManager battleManager, params string[] arguments); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/Commands/ICommandManager.cs: -------------------------------------------------------------------------------- 1 | using ArmyOfCreatures.Logic.Battles; 2 | 3 | namespace ArmyOfCreatures.Console.Commands 4 | { 5 | public interface ICommandManager 6 | { 7 | void ProcessCommand(string commandLine, IBattleManager battleManager); 8 | } 9 | } -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Console/ConsoleWriter.cs: -------------------------------------------------------------------------------- 1 | using ArmyOfCreatures.Logic; 2 | 3 | namespace ArmyOfCreatures.Console 4 | { 5 | public class ConsoleLogger : ILogger 6 | { 7 | public void WriteLine(string line) 8 | { 9 | System.Console.WriteLine(line); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Creatures/AncientBehemoth.cs: -------------------------------------------------------------------------------- 1 | using ArmyOfCreatures.Logic.Creatures; 2 | using ArmyOfCreatures.Logic.Specialties; 3 | 4 | namespace ArmyOfCreatures.Extended.Creatures 5 | { 6 | public class AncientBehemoth : Creature 7 | { 8 | public AncientBehemoth() 9 | : base(19, 19, 300, 40M) 10 | { 11 | this.AddSpecialty(new ReduceEnemyDefenseByPercentage(80)); 12 | this.AddSpecialty(new DoubleDefenseWhenDefending(5)); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Creatures/CyclopsKing.cs: -------------------------------------------------------------------------------- 1 | using ArmyOfCreatures.Extended.Specialties; 2 | using ArmyOfCreatures.Logic.Creatures; 3 | 4 | namespace ArmyOfCreatures.Extended.Creatures 5 | { 6 | public class CyclopsKing : Creature 7 | { 8 | public CyclopsKing() 9 | : base(17, 13, 70, 18) 10 | { 11 | this.AddSpecialty(new AddAttackWhenSkip(3)); 12 | this.AddSpecialty(new DoubleAttackWhenAttacking(4)); 13 | this.AddSpecialty(new DoubleDamage(1)); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Creatures/Goblin.cs: -------------------------------------------------------------------------------- 1 | using ArmyOfCreatures.Logic.Creatures; 2 | 3 | namespace ArmyOfCreatures.Extended.Creatures 4 | { 5 | public class Goblin : Creature 6 | { 7 | public Goblin() 8 | : base(4, 2, 5, 1.5M) 9 | { 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Creatures/Griffin.cs: -------------------------------------------------------------------------------- 1 | using ArmyOfCreatures.Logic.Creatures; 2 | using ArmyOfCreatures.Logic.Specialties; 3 | 4 | namespace ArmyOfCreatures.Extended.Creatures 5 | { 6 | public class Griffin : Creature 7 | { 8 | public Griffin() 9 | : base(8, 8, 25, 4.5M) 10 | { 11 | this.AddSpecialty(new DoubleDefenseWhenDefending(5)); 12 | this.AddSpecialty(new AddDefenseWhenSkip(3)); 13 | this.AddSpecialty(new Hate(typeof(WolfRaider))); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Extended/Creatures/WolfRaider.cs: -------------------------------------------------------------------------------- 1 | using ArmyOfCreatures.Extended.Specialties; 2 | using ArmyOfCreatures.Logic.Creatures; 3 | 4 | namespace ArmyOfCreatures.Extended.Creatures 5 | { 6 | public class WolfRaider : Creature 7 | { 8 | public WolfRaider() 9 | : base(8, 5, 10, 3.5M) 10 | { 11 | this.AddSpecialty(new DoubleDamage(7)); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Battles/IBattleManager.cs: -------------------------------------------------------------------------------- 1 | namespace ArmyOfCreatures.Logic.Battles 2 | { 3 | public interface IBattleManager 4 | { 5 | void AddCreatures(CreatureIdentifier creatureIdentifier, int count); 6 | 7 | void Attack(CreatureIdentifier attackerIdentifier, CreatureIdentifier defenderIdentifier); 8 | 9 | void Skip(CreatureIdentifier creatureIdentifier); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Battles/ICreaturesInBattle.cs: -------------------------------------------------------------------------------- 1 | using ArmyOfCreatures.Logic.Creatures; 2 | 3 | namespace ArmyOfCreatures.Logic.Battles 4 | { 5 | public interface ICreaturesInBattle 6 | { 7 | Creature Creature { get; } 8 | 9 | int CurrentAttack { get; set; } 10 | 11 | int PermanentAttack { get; set; } 12 | 13 | int CurrentDefense { get; set; } 14 | 15 | int PermanentDefense { get; set; } 16 | 17 | int TotalHitPoints { get; set; } 18 | 19 | int Count { get; } 20 | 21 | void DealDamage(ICreaturesInBattle defender); 22 | 23 | void Skip(); 24 | 25 | void StartNewTurn(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/Angel.cs: -------------------------------------------------------------------------------- 1 | using ArmyOfCreatures.Logic.Specialties; 2 | 3 | namespace ArmyOfCreatures.Logic.Creatures 4 | { 5 | public class Angel : Creature 6 | { 7 | public Angel() 8 | : base(20, 20, 200, 50) 9 | { 10 | this.AddSpecialty(new Hate(typeof(Devil))); 11 | this.AddSpecialty(new Hate(typeof(ArchDevil))); 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/ArchDevil.cs: -------------------------------------------------------------------------------- 1 | using ArmyOfCreatures.Logic.Specialties; 2 | 3 | namespace ArmyOfCreatures.Logic.Creatures 4 | { 5 | public class ArchDevil : Creature 6 | { 7 | public ArchDevil() 8 | : base(21, 28, 200, 35) 9 | { 10 | this.AddSpecialty(new Hate(typeof(Angel))); 11 | this.AddSpecialty(new Hate(typeof(Archangel))); 12 | this.AddSpecialty(new ReduceEnemyDefenseByPercentage(100)); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/Archangel.cs: -------------------------------------------------------------------------------- 1 | using ArmyOfCreatures.Logic.Specialties; 2 | 3 | namespace ArmyOfCreatures.Logic.Creatures 4 | { 5 | public class Archangel : Creature 6 | { 7 | public Archangel() 8 | : base(30, 30, 250, 50) 9 | { 10 | this.AddSpecialty(new Hate(typeof(Devil))); 11 | this.AddSpecialty(new Hate(typeof(ArchDevil))); 12 | this.AddSpecialty(new Resurrection()); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/Behemoth.cs: -------------------------------------------------------------------------------- 1 | using ArmyOfCreatures.Logic.Specialties; 2 | 3 | namespace ArmyOfCreatures.Logic.Creatures 4 | { 5 | public class Behemoth : Creature 6 | { 7 | public Behemoth() 8 | : base(17, 17, 160, 40) 9 | { 10 | this.AddSpecialty(new ReduceEnemyDefenseByPercentage(40)); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Creatures/Devil.cs: -------------------------------------------------------------------------------- 1 | using ArmyOfCreatures.Logic.Specialties; 2 | 3 | namespace ArmyOfCreatures.Logic.Creatures 4 | { 5 | public class Devil : Creature 6 | { 7 | public Devil() 8 | : base(19, 26, 160, 35) 9 | { 10 | this.AddSpecialty(new Hate(typeof(Angel))); 11 | this.AddSpecialty(new Hate(typeof(Archangel))); 12 | this.AddSpecialty(new ReduceEnemyDefenseByPercentage(100)); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/ICreaturesFactory.cs: -------------------------------------------------------------------------------- 1 | using ArmyOfCreatures.Logic.Creatures; 2 | 3 | namespace ArmyOfCreatures.Logic 4 | { 5 | public interface ICreaturesFactory 6 | { 7 | Creature CreateCreature(string name); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/ILogger.cs: -------------------------------------------------------------------------------- 1 | namespace ArmyOfCreatures.Logic 2 | { 3 | public interface ILogger 4 | { 5 | void WriteLine(string line); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Solution/ArmyOfCreatures/Logic/Specialties/Resurrection.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | using ArmyOfCreatures.Logic.Battles; 4 | 5 | namespace ArmyOfCreatures.Logic.Specialties 6 | { 7 | public class Resurrection : Specialty 8 | { 9 | public override void ApplyAfterDefending(ICreaturesInBattle defenderWithSpecialty) 10 | { 11 | if (defenderWithSpecialty == null) 12 | { 13 | throw new ArgumentNullException("defenderWithSpecialty"); 14 | } 15 | 16 | if (defenderWithSpecialty.TotalHitPoints > 0) 17 | { 18 | defenderWithSpecialty.TotalHitPoints = defenderWithSpecialty.Count 19 | * defenderWithSpecialty.Creature.HealthPoints; 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.000.001.in.txt: -------------------------------------------------------------------------------- 1 | add 10 AncientBehemoth(1) 2 | add 100 WolfRaider(1) 3 | add 100 Goblin(1) 4 | add 10 CyclopsKing(2) 5 | add 50 Griffin(2) 6 | add 10 Archangel(2) 7 | attack Archangel(2) Goblin(1) 8 | attack AncientBehemoth(1) Archangel(2) 9 | attack Griffin(2) WolfRaider(1) 10 | attack WolfRaider(1) Griffin(2) 11 | skip CyclopsKing(2) 12 | attack Archangel(2) WolfRaider(1) 13 | attack AncientBehemoth(1) Archangel(2) 14 | attack Griffin(2) AncientBehemoth(1) 15 | attack CyclopsKing(2) AncientBehemoth(1) 16 | attack Archangel(2) AncientBehemoth(1) 17 | attack AncientBehemoth(1) CyclopsKing(2) 18 | attack Griffin(2) AncientBehemoth(1) 19 | attack CyclopsKing(2) AncientBehemoth(1) 20 | attack Archangel(2) AncientBehemoth(1) 21 | attack AncientBehemoth(1) CyclopsKing(2) 22 | exit 23 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.000.002.in.txt: -------------------------------------------------------------------------------- 1 | add 10 Angel(1) 2 | add 10 Devil(1) 3 | add 10 Archangel(2) 4 | add 10 ArchDevil(3) 5 | attack Archangel(2) Devil(1) 6 | attack ArchDevil(3) Angel(1) 7 | attack Angel(1) ArchDevil(3) 8 | attack Devil(1) Archangel(2) 9 | attack Archangel(2) Devil(1) 10 | attack ArchDevil(3) Angel(1) 11 | attack Archangel(2) ArchDevil(3) 12 | attack ArchDevil(3) Archangel(2) 13 | attack Archangel(2) ArchDevil(3) 14 | attack ArchDevil(3) Archangel(2) 15 | attack Archangel(2) ArchDevil(3) 16 | attack ArchDevil(3) Archangel(2) 17 | attack Archangel(2) ArchDevil(3) 18 | exit 19 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.001.in.txt: -------------------------------------------------------------------------------- 1 | add 10 Goblin(1) 2 | add 11 Goblin(2) 3 | attack Goblin(1) Goblin(2) 4 | attack Goblin(2) Goblin(1) 5 | attack Goblin(1) Goblin(2) 6 | attack Goblin(2) Goblin(1) 7 | attack Goblin(1) Goblin(2) 8 | attack Goblin(2) Goblin(1) 9 | attack Goblin(1) Goblin(2) 10 | attack Goblin(2) Goblin(1) 11 | attack Goblin(1) Goblin(2) 12 | attack Goblin(2) Goblin(1) 13 | attack Goblin(1) Goblin(2) 14 | exit 15 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.002.in.txt: -------------------------------------------------------------------------------- 1 | add 1000 Goblin(1) 2 | add 10 AncientBehemoth(2) 3 | attack Goblin(1) AncientBehemoth(2) 4 | attack AncientBehemoth(2) Goblin(1) 5 | attack Goblin(1) AncientBehemoth(2) 6 | attack AncientBehemoth(2) Goblin(1) 7 | attack Goblin(1) AncientBehemoth(2) 8 | attack AncientBehemoth(2) Goblin(1) 9 | attack Goblin(1) AncientBehemoth(2) 10 | attack AncientBehemoth(2) Goblin(1) 11 | attack Goblin(1) AncientBehemoth(2) 12 | attack AncientBehemoth(2) Goblin(1) 13 | attack Goblin(1) AncientBehemoth(2) 14 | attack AncientBehemoth(2) Goblin(1) 15 | attack Goblin(1) AncientBehemoth(2) 16 | attack AncientBehemoth(2) Goblin(1) 17 | attack Goblin(1) AncientBehemoth(2) 18 | attack AncientBehemoth(2) Goblin(1) 19 | attack Goblin(1) AncientBehemoth(2) 20 | exit 21 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.003.in.txt: -------------------------------------------------------------------------------- 1 | add 10 WolfRaider(1) 2 | add 50 Goblin(2) 3 | attack WolfRaider(1) Goblin(2) 4 | attack Goblin(2) WolfRaider(1) 5 | attack WolfRaider(1) Goblin(2) 6 | attack Goblin(2) WolfRaider(1) 7 | attack WolfRaider(1) Goblin(2) 8 | attack Goblin(2) WolfRaider(1) 9 | attack WolfRaider(1) Goblin(2) 10 | attack Goblin(2) WolfRaider(1) 11 | exit 12 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.004.in.txt: -------------------------------------------------------------------------------- 1 | add 10 AncientBehemoth(1) 2 | add 375 WolfRaider(2) 3 | attack AncientBehemoth(1) WolfRaider(2) 4 | attack WolfRaider(2) AncientBehemoth(1) 5 | attack AncientBehemoth(1) WolfRaider(2) 6 | attack WolfRaider(2) AncientBehemoth(1) 7 | attack AncientBehemoth(1) WolfRaider(2) 8 | attack WolfRaider(2) AncientBehemoth(1) 9 | attack AncientBehemoth(1) WolfRaider(2) 10 | attack WolfRaider(2) AncientBehemoth(1) 11 | attack AncientBehemoth(1) WolfRaider(2) 12 | attack WolfRaider(2) AncientBehemoth(1) 13 | attack AncientBehemoth(1) WolfRaider(2) 14 | attack WolfRaider(2) AncientBehemoth(1) 15 | attack AncientBehemoth(1) WolfRaider(2) 16 | attack WolfRaider(2) AncientBehemoth(1) 17 | attack AncientBehemoth(1) WolfRaider(2) 18 | attack WolfRaider(2) AncientBehemoth(1) 19 | exit 20 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.005.in.txt: -------------------------------------------------------------------------------- 1 | add 101 Griffin(1) 2 | add 11 AncientBehemoth(1) 3 | add 400 WolfRaider(2) 4 | add 51 Goblin(2) 5 | attack AncientBehemoth(1) WolfRaider(2) 6 | attack WolfRaider(2) AncientBehemoth(1) 7 | skip Griffin(1) 8 | attack Goblin(2) AncientBehemoth(1) 9 | attack AncientBehemoth(1) Goblin(2) 10 | attack WolfRaider(2) Griffin(1) 11 | attack Griffin(1) WolfRaider(2) 12 | attack AncientBehemoth(1) WolfRaider(2) 13 | attack WolfRaider(2) Griffin(1) 14 | attack Griffin(1) WolfRaider(2) 15 | attack AncientBehemoth(1) WolfRaider(2) 16 | attack WolfRaider(2) Griffin(1) 17 | attack Griffin(1) WolfRaider(2) 18 | attack AncientBehemoth(1) WolfRaider(2) 19 | attack WolfRaider(2) Griffin(1) 20 | attack Griffin(1) WolfRaider(2) 21 | attack AncientBehemoth(1) WolfRaider(2) 22 | exit 23 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.008.in.txt: -------------------------------------------------------------------------------- 1 | add 11 Angel(1) 2 | add 11 Devil(1) 3 | add 11 Archangel(2) 4 | add 11 ArchDevil(3) 5 | attack Archangel(2) Devil(1) 6 | attack ArchDevil(3) Angel(1) 7 | attack Angel(1) ArchDevil(3) 8 | attack Devil(1) Archangel(2) 9 | attack Archangel(2) Devil(1) 10 | attack ArchDevil(3) Angel(1) 11 | attack Archangel(2) ArchDevil(3) 12 | attack ArchDevil(3) Archangel(2) 13 | attack Archangel(2) ArchDevil(3) 14 | attack ArchDevil(3) Archangel(2) 15 | attack Archangel(2) ArchDevil(3) 16 | attack ArchDevil(3) Archangel(2) 17 | attack Archangel(2) ArchDevil(3) 18 | exit 19 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/ArmyOfCreatures-Evening-livedemo/ArmyOfCreatures-All/Tests/test.009.in.txt: -------------------------------------------------------------------------------- 1 | add 100 AncientBehemoth(1) 2 | add 1000 CyclopsKing(2) 3 | add 9000 WolfRaider(3) 4 | add 20000 Goblin(3) 5 | add 5000 Griffin(3) 6 | attack AncientBehemoth(1) WolfRaider(3) 7 | attack CyclopsKing(2) Goblin(3) 8 | skip Griffin(3) 9 | attack WolfRaider(3) CyclopsKing(2) 10 | attack Goblin(3) CyclopsKing(2) 11 | attack AncientBehemoth(1) WolfRaider(3) 12 | attack CyclopsKing(2) WolfRaider(3) 13 | attack Griffin(3) CyclopsKing(2) 14 | attack WolfRaider(3) AncientBehemoth(1) 15 | attack Goblin(3) AncientBehemoth(1) 16 | attack AncientBehemoth(1) WolfRaider(3) 17 | attack Griffin(3) AncientBehemoth(1) 18 | skip WolfRaider(3) 19 | attack AncientBehemoth(1) WolfRaider(3) 20 | attack Griffin(3) AncientBehemoth(1) 21 | attack WolfRaider(3) AncientBehemoth(1) 22 | exit 23 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures.Tests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Commands/ExitCommand.cs: -------------------------------------------------------------------------------- 1 | namespace ArmyOfCreatures.Console.Commands 2 | { 3 | using System; 4 | 5 | using ArmyOfCreatures.Logic.Battles; 6 | 7 | public class ExitCommand : ICommand 8 | { 9 | public void ProcessCommand(IBattleManager battleManager, params string[] arguments) 10 | { 11 | Environment.Exit(0); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Commands/ICommand.cs: -------------------------------------------------------------------------------- 1 | namespace ArmyOfCreatures.Console.Commands 2 | { 3 | using ArmyOfCreatures.Logic.Battles; 4 | 5 | public interface ICommand 6 | { 7 | void ProcessCommand(IBattleManager battleManager, params string[] arguments); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/Commands/ICommandManager.cs: -------------------------------------------------------------------------------- 1 | namespace ArmyOfCreatures.Console.Commands 2 | { 3 | using ArmyOfCreatures.Logic.Battles; 4 | 5 | public interface ICommandManager 6 | { 7 | void ProcessCommand(string commandLine, IBattleManager battleManager); 8 | } 9 | } -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Console/ConsoleWriter.cs: -------------------------------------------------------------------------------- 1 | namespace ArmyOfCreatures.Console 2 | { 3 | using System; 4 | 5 | using ArmyOfCreatures.Logic; 6 | 7 | public class ConsoleLogger : ILogger 8 | { 9 | public void WriteLine(string line) 10 | { 11 | Console.WriteLine(line); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Creatures/AncientBehemoth.cs: -------------------------------------------------------------------------------- 1 | namespace ArmyOfCreatures.Extended.Creatures 2 | { 3 | using ArmyOfCreatures.Logic.Creatures; 4 | using ArmyOfCreatures.Logic.Specialties; 5 | 6 | public class AncientBehemoth : Creature 7 | { 8 | public AncientBehemoth() 9 | : base(19, 19, 300, 40M) 10 | { 11 | this.AddSpecialty(new ReduceEnemyDefenseByPercentage(80)); 12 | this.AddSpecialty(new DoubleDefenseWhenDefending(5)); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Creatures/CyclopsKing.cs: -------------------------------------------------------------------------------- 1 | namespace ArmyOfCreatures.Extended.Creatures 2 | { 3 | using ArmyOfCreatures.Extended.Specialties; 4 | using ArmyOfCreatures.Logic.Creatures; 5 | 6 | public class CyclopsKing : Creature 7 | { 8 | public CyclopsKing() 9 | : base(17, 13, 70, 18) 10 | { 11 | this.AddSpecialty(new AddAttackWhenSkip(3)); 12 | this.AddSpecialty(new DoubleAttackWhenAttacking(4)); 13 | this.AddSpecialty(new DoubleDamage(1)); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Creatures/Goblin.cs: -------------------------------------------------------------------------------- 1 | namespace ArmyOfCreatures.Extended.Creatures 2 | { 3 | using ArmyOfCreatures.Logic.Creatures; 4 | 5 | public class Goblin : Creature 6 | { 7 | public Goblin() 8 | : base(4, 2, 5, 1.5M) 9 | { 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Creatures/Griffin.cs: -------------------------------------------------------------------------------- 1 | namespace ArmyOfCreatures.Extended.Creatures 2 | { 3 | using ArmyOfCreatures.Logic.Creatures; 4 | using ArmyOfCreatures.Logic.Specialties; 5 | 6 | public class Griffin : Creature 7 | { 8 | public Griffin() 9 | : base(8, 8, 25, 4.5M) 10 | { 11 | this.AddSpecialty(new DoubleDefenseWhenDefending(5)); 12 | this.AddSpecialty(new AddDefenseWhenSkip(3)); 13 | this.AddSpecialty(new Hate(typeof(WolfRaider))); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Extended/Creatures/WolfRaider.cs: -------------------------------------------------------------------------------- 1 | namespace ArmyOfCreatures.Extended.Creatures 2 | { 3 | using ArmyOfCreatures.Extended.Specialties; 4 | using ArmyOfCreatures.Logic.Creatures; 5 | 6 | public class WolfRaider : Creature 7 | { 8 | public WolfRaider() 9 | : base(8, 5, 10, 3.5M) 10 | { 11 | this.AddSpecialty(new DoubleDamage(7)); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Battles/IBattleManager.cs: -------------------------------------------------------------------------------- 1 | namespace ArmyOfCreatures.Logic.Battles 2 | { 3 | public interface IBattleManager 4 | { 5 | void AddCreatures(CreatureIdentifier creatureIdentifier, int count); 6 | 7 | void Attack(CreatureIdentifier attackerIdentifier, CreatureIdentifier defenderIdentifier); 8 | 9 | void Skip(CreatureIdentifier creatureIdentifier); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Battles/ICreaturesInBattle.cs: -------------------------------------------------------------------------------- 1 | namespace ArmyOfCreatures.Logic.Battles 2 | { 3 | using ArmyOfCreatures.Logic.Creatures; 4 | 5 | public interface ICreaturesInBattle 6 | { 7 | Creature Creature { get; } 8 | 9 | int CurrentAttack { get; set; } 10 | 11 | int PermanentAttack { get; set; } 12 | 13 | int CurrentDefense { get; set; } 14 | 15 | int PermanentDefense { get; set; } 16 | 17 | int TotalHitPoints { get; set; } 18 | 19 | int Count { get; } 20 | 21 | void DealDamage(ICreaturesInBattle defender); 22 | 23 | void Skip(); 24 | 25 | void StartNewTurn(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Creatures/Angel.cs: -------------------------------------------------------------------------------- 1 | namespace ArmyOfCreatures.Logic.Creatures 2 | { 3 | using ArmyOfCreatures.Logic.Specialties; 4 | 5 | public class Angel : Creature 6 | { 7 | public Angel() 8 | : base(20, 20, 200, 50) 9 | { 10 | this.AddSpecialty(new Hate(typeof(Devil))); 11 | this.AddSpecialty(new Hate(typeof(ArchDevil))); 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Creatures/ArchDevil.cs: -------------------------------------------------------------------------------- 1 | namespace ArmyOfCreatures.Logic.Creatures 2 | { 3 | using ArmyOfCreatures.Logic.Specialties; 4 | 5 | public class ArchDevil : Creature 6 | { 7 | public ArchDevil() 8 | : base(21, 28, 200, 35) 9 | { 10 | this.AddSpecialty(new Hate(typeof(Angel))); 11 | this.AddSpecialty(new Hate(typeof(Archangel))); 12 | this.AddSpecialty(new ReduceEnemyDefenseByPercentage(100)); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Creatures/Archangel.cs: -------------------------------------------------------------------------------- 1 | namespace ArmyOfCreatures.Logic.Creatures 2 | { 3 | using ArmyOfCreatures.Logic.Specialties; 4 | 5 | public class Archangel : Creature 6 | { 7 | public Archangel() 8 | : base(30, 30, 250, 50) 9 | { 10 | this.AddSpecialty(new Hate(typeof(Devil))); 11 | this.AddSpecialty(new Hate(typeof(ArchDevil))); 12 | this.AddSpecialty(new Resurrection()); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Creatures/Behemoth.cs: -------------------------------------------------------------------------------- 1 | namespace ArmyOfCreatures.Logic.Creatures 2 | { 3 | using ArmyOfCreatures.Logic.Specialties; 4 | 5 | public class Behemoth : Creature 6 | { 7 | public Behemoth() 8 | : base(17, 17, 160, 40) 9 | { 10 | this.AddSpecialty(new ReduceEnemyDefenseByPercentage(40)); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Creatures/Devil.cs: -------------------------------------------------------------------------------- 1 | namespace ArmyOfCreatures.Logic.Creatures 2 | { 3 | using ArmyOfCreatures.Logic.Specialties; 4 | 5 | public class Devil : Creature 6 | { 7 | public Devil() 8 | : base(19, 26, 160, 35) 9 | { 10 | this.AddSpecialty(new Hate(typeof(Angel))); 11 | this.AddSpecialty(new Hate(typeof(Archangel))); 12 | this.AddSpecialty(new ReduceEnemyDefenseByPercentage(100)); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/ICreaturesFactory.cs: -------------------------------------------------------------------------------- 1 | namespace ArmyOfCreatures.Logic 2 | { 3 | using ArmyOfCreatures.Logic.Creatures; 4 | 5 | public interface ICreaturesFactory 6 | { 7 | Creature CreateCreature(string name); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/ILogger.cs: -------------------------------------------------------------------------------- 1 | namespace ArmyOfCreatures.Logic 2 | { 3 | public interface ILogger 4 | { 5 | void WriteLine(string line); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Topics/04. Workshops/Workshop (Trainers)/Live-Demo-Morning-Lecture/ArmyOfCreatures/Logic/Specialties/Resurrection.cs: -------------------------------------------------------------------------------- 1 | namespace ArmyOfCreatures.Logic.Specialties 2 | { 3 | using System; 4 | 5 | using ArmyOfCreatures.Logic.Battles; 6 | 7 | public class Resurrection : Specialty 8 | { 9 | public override void ApplyAfterDefending(ICreaturesInBattle defenderWithSpecialty) 10 | { 11 | if (defenderWithSpecialty == null) 12 | { 13 | throw new ArgumentNullException("defenderWithSpecialty"); 14 | } 15 | 16 | if (defenderWithSpecialty.TotalHitPoints > 0) 17 | { 18 | defenderWithSpecialty.TotalHitPoints = defenderWithSpecialty.Count 19 | * defenderWithSpecialty.Creature.HealthPoints; 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Author solution/IntergalacticTravel.Tests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Author solution/IntergalacticTravel/Constants/GlobalConstants.cs: -------------------------------------------------------------------------------- 1 | namespace IntergalacticTravel.Constants 2 | { 3 | public class GlobalConstants 4 | { 5 | public const uint BronzeCoinsDefaultAmount = 0; 6 | public const uint SilverCoinsDefaultAmount = 0; 7 | public const uint GoldCoinsDefaultAmount = 0; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Author solution/IntergalacticTravel/Contracts/IBusinessOwner.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace IntergalacticTravel.Contracts 4 | { 5 | public interface IBusinessOwner : IUnit 6 | { 7 | ICollection TeleportStations { get; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Author solution/IntergalacticTravel/Contracts/IGPSCoordinates.cs: -------------------------------------------------------------------------------- 1 | namespace IntergalacticTravel.Contracts 2 | { 3 | /// 4 | /// Represents the Global Positioning System Coordinates 5 | /// 6 | public interface IGPSCoordinates 7 | { 8 | double Longtitude { get; } 9 | 10 | double Latitude { get; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Author solution/IntergalacticTravel/Contracts/IGalaxy.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace IntergalacticTravel.Contracts 4 | { 5 | public interface IGalaxy : INameable 6 | { 7 | ICollection Planets { get; } 8 | } 9 | } -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Author solution/IntergalacticTravel/Contracts/ILocation.cs: -------------------------------------------------------------------------------- 1 | namespace IntergalacticTravel.Contracts 2 | { 3 | public interface ILocation 4 | { 5 | IPlanet Planet { get; } 6 | 7 | IGPSCoordinates Coordinates { get; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Author solution/IntergalacticTravel/Contracts/INameable.cs: -------------------------------------------------------------------------------- 1 | namespace IntergalacticTravel.Contracts 2 | { 3 | public interface INameable 4 | { 5 | string Name { get; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Author solution/IntergalacticTravel/Contracts/IPath.cs: -------------------------------------------------------------------------------- 1 | namespace IntergalacticTravel.Contracts 2 | { 3 | public interface IPath 4 | { 5 | ILocation TargetLocation { get; } 6 | 7 | IResources Cost { get; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Author solution/IntergalacticTravel/Contracts/IPlanet.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace IntergalacticTravel.Contracts 4 | { 5 | public interface IPlanet : INameable 6 | { 7 | IGalaxy Galaxy { get; } 8 | 9 | ICollection Units { get; } 10 | } 11 | } -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Author solution/IntergalacticTravel/Contracts/IResources.cs: -------------------------------------------------------------------------------- 1 | namespace IntergalacticTravel.Contracts 2 | { 3 | public interface IResources 4 | { 5 | uint GoldCoins { get; set; } 6 | 7 | uint SilverCoins { get; set; } 8 | 9 | uint BronzeCoins { get; set; } 10 | 11 | void Add(IResources payment); 12 | 13 | bool IsEqualTo(IResources resource); 14 | 15 | void Clear(); 16 | 17 | IResources Clone(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Author solution/IntergalacticTravel/Contracts/IResourcesFactory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace IntergalacticTravel.Contracts 8 | { 9 | public interface IResourcesFactory 10 | { 11 | IResources GetResources(string command); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Author solution/IntergalacticTravel/Contracts/ITeleportStation.cs: -------------------------------------------------------------------------------- 1 | namespace IntergalacticTravel.Contracts 2 | { 3 | public interface ITeleportStation 4 | { 5 | void TeleportUnit(IUnit unitToTeleport, ILocation targetLocation); 6 | 7 | IResources PayProfits(IBusinessOwner owner); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Author solution/IntergalacticTravel/Contracts/IUnit.cs: -------------------------------------------------------------------------------- 1 | namespace IntergalacticTravel.Contracts 2 | { 3 | public interface IUnit 4 | { 5 | int IdentificationNumber { get; } 6 | 7 | string NickName { get; } 8 | 9 | IResources Resources { get; } 10 | 11 | ILocation CurrentLocation { get; set; } 12 | 13 | ILocation PreviousLocation { get; set; } 14 | 15 | bool CanPay(IResources cost); 16 | 17 | IResources Pay(IResources cost); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Author solution/IntergalacticTravel/Exceptions/InsufficientResourcesException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.Serialization; 3 | 4 | namespace IntergalacticTravel.Exceptions 5 | { 6 | public class InsufficientResourcesException : Exception 7 | { 8 | public InsufficientResourcesException() 9 | { 10 | } 11 | 12 | public InsufficientResourcesException(string message) : base(message) 13 | { 14 | } 15 | 16 | public InsufficientResourcesException(string message, Exception innerException) : base(message, innerException) 17 | { 18 | } 19 | 20 | protected InsufficientResourcesException(SerializationInfo info, StreamingContext context) : base(info, context) 21 | { 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Author solution/IntergalacticTravel/Exceptions/InvalidTeleportationLocationException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.Serialization; 3 | 4 | namespace IntergalacticTravel.Exceptions 5 | { 6 | public class InvalidTeleportationLocationException : Exception 7 | { 8 | public InvalidTeleportationLocationException() 9 | { 10 | } 11 | 12 | public InvalidTeleportationLocationException(string message) : base(message) 13 | { 14 | } 15 | 16 | public InvalidTeleportationLocationException(string message, Exception innerException) : base(message, innerException) 17 | { 18 | } 19 | 20 | protected InvalidTeleportationLocationException(SerializationInfo info, StreamingContext context) : base(info, context) 21 | { 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Author solution/IntergalacticTravel/Exceptions/InvalidUnitCreationCommandException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.Serialization; 3 | 4 | namespace IntergalacticTravel.Exceptions 5 | { 6 | public class InvalidUnitCreationCommandException : Exception 7 | { 8 | public InvalidUnitCreationCommandException() 9 | { 10 | } 11 | 12 | public InvalidUnitCreationCommandException(string message) : base(message) 13 | { 14 | } 15 | 16 | public InvalidUnitCreationCommandException(string message, Exception innerException) : base(message, innerException) 17 | { 18 | } 19 | 20 | protected InvalidUnitCreationCommandException(SerializationInfo info, StreamingContext context) : base(info, context) 21 | { 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Author solution/IntergalacticTravel/Exceptions/LocationNotFoundException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.Serialization; 3 | 4 | namespace IntergalacticTravel.Exceptions 5 | { 6 | public class LocationNotFoundException : Exception 7 | { 8 | public LocationNotFoundException() 9 | { 10 | } 11 | 12 | public LocationNotFoundException(string message) : base(message) 13 | { 14 | } 15 | 16 | public LocationNotFoundException(string message, Exception innerException) : base(message, innerException) 17 | { 18 | } 19 | 20 | protected LocationNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context) 21 | { 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Author solution/IntergalacticTravel/Extensions/IEnumerableExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | 4 | namespace IntergalacticTravel.Extensions 5 | { 6 | public static class IEnumerableExtensions 7 | { 8 | public static bool IsNullOrEmpty(this IEnumerable enumeration) 9 | { 10 | return enumeration == null || 11 | enumeration.Count() == 0; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Author solution/IntergalacticTravel/Extensions/ObjectExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace IntergalacticTravel.Extensions 2 | { 3 | public static class ObjectExtensions 4 | { 5 | public static bool IsNull(this object obj) 6 | { 7 | return obj == null; 8 | } 9 | 10 | public static bool IsNotNull(this object obj) 11 | { 12 | return obj != null; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Author solution/IntergalacticTravel/Lacaille.cs: -------------------------------------------------------------------------------- 1 | namespace IntergalacticTravel 2 | { 3 | /// 4 | /// Imma dummy class 5 | /// 6 | internal class Lacaille : Unit 7 | { 8 | public Lacaille(int identificationNumber, string nickName) : base(identificationNumber, nickName) 9 | { 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Author solution/IntergalacticTravel/Luyten.cs: -------------------------------------------------------------------------------- 1 | namespace IntergalacticTravel 2 | { 3 | /// 4 | /// Imma dummy class 5 | /// 6 | internal class Luyten : Unit 7 | { 8 | public Luyten(int identificationNumber, string nickName) : base(identificationNumber, nickName) 9 | { 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Author solution/IntergalacticTravel/Procyon.cs: -------------------------------------------------------------------------------- 1 | namespace IntergalacticTravel 2 | { 3 | /// 4 | /// Imma dummy class 5 | /// 6 | internal class Procyon : Unit 7 | { 8 | public Procyon(int identificationNumber, string nickName) : base(identificationNumber, nickName) 9 | { 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Author solution/IntergalacticTravel/TheOneThatRulesThemAll.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace IntergalacticTravel 8 | { 9 | public class TheOneThatRulesThemAll 10 | { 11 | public void RuleThem() 12 | { 13 | 14 | // Create galactic map 15 | 16 | // Create units 17 | 18 | // Give them some resources 19 | 20 | // Set their location 21 | 22 | // Teleport them 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Skeleton/IntergalacticTravel.Tests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Skeleton/IntergalacticTravel/Constants/GlobalConstants.cs: -------------------------------------------------------------------------------- 1 | namespace IntergalacticTravel.Constants 2 | { 3 | public class GlobalConstants 4 | { 5 | public const uint BronzeCoinsDefaultAmount = 0; 6 | public const uint SilverCoinsDefaultAmount = 0; 7 | public const uint GoldCoinsDefaultAmount = 0; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Skeleton/IntergalacticTravel/Contracts/IBusinessOwner.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace IntergalacticTravel.Contracts 4 | { 5 | public interface IBusinessOwner : IUnit 6 | { 7 | ICollection TeleportStations { get; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Skeleton/IntergalacticTravel/Contracts/IGPSCoordinates.cs: -------------------------------------------------------------------------------- 1 | namespace IntergalacticTravel.Contracts 2 | { 3 | /// 4 | /// Represents the Global Positioning System Coordinates 5 | /// 6 | public interface IGPSCoordinates 7 | { 8 | double Longtitude { get; } 9 | 10 | double Latitude { get; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Skeleton/IntergalacticTravel/Contracts/IGalaxy.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace IntergalacticTravel.Contracts 4 | { 5 | public interface IGalaxy : INameable 6 | { 7 | ICollection Planets { get; } 8 | } 9 | } -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Skeleton/IntergalacticTravel/Contracts/ILocation.cs: -------------------------------------------------------------------------------- 1 | namespace IntergalacticTravel.Contracts 2 | { 3 | public interface ILocation 4 | { 5 | IPlanet Planet { get; } 6 | 7 | IGPSCoordinates Coordinates { get; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Skeleton/IntergalacticTravel/Contracts/INameable.cs: -------------------------------------------------------------------------------- 1 | namespace IntergalacticTravel.Contracts 2 | { 3 | public interface INameable 4 | { 5 | string Name { get; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Skeleton/IntergalacticTravel/Contracts/IPath.cs: -------------------------------------------------------------------------------- 1 | namespace IntergalacticTravel.Contracts 2 | { 3 | public interface IPath 4 | { 5 | ILocation TargetLocation { get; } 6 | 7 | IResources Cost { get; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Skeleton/IntergalacticTravel/Contracts/IPlanet.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace IntergalacticTravel.Contracts 4 | { 5 | public interface IPlanet : INameable 6 | { 7 | IGalaxy Galaxy { get; } 8 | 9 | ICollection Units { get; } 10 | } 11 | } -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Skeleton/IntergalacticTravel/Contracts/IResources.cs: -------------------------------------------------------------------------------- 1 | namespace IntergalacticTravel.Contracts 2 | { 3 | public interface IResources 4 | { 5 | uint GoldCoins { get; set; } 6 | 7 | uint SilverCoins { get; set; } 8 | 9 | uint BronzeCoins { get; set; } 10 | 11 | void Add(IResources payment); 12 | 13 | bool IsEqualTo(IResources resource); 14 | 15 | void Clear(); 16 | 17 | IResources Clone(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Skeleton/IntergalacticTravel/Contracts/IResourcesFactory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace IntergalacticTravel.Contracts 8 | { 9 | public interface IResourcesFactory 10 | { 11 | IResources GetResources(string command); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Skeleton/IntergalacticTravel/Contracts/ITeleportStation.cs: -------------------------------------------------------------------------------- 1 | namespace IntergalacticTravel.Contracts 2 | { 3 | public interface ITeleportStation 4 | { 5 | void TeleportUnit(IUnit unitToTeleport, ILocation targetLocation); 6 | 7 | IResources PayProfits(IBusinessOwner owner); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Skeleton/IntergalacticTravel/Contracts/IUnit.cs: -------------------------------------------------------------------------------- 1 | namespace IntergalacticTravel.Contracts 2 | { 3 | public interface IUnit 4 | { 5 | int IdentificationNumber { get; } 6 | 7 | string NickName { get; } 8 | 9 | IResources Resources { get; } 10 | 11 | ILocation CurrentLocation { get; set; } 12 | 13 | ILocation PreviousLocation { get; set; } 14 | 15 | bool CanPay(IResources cost); 16 | 17 | IResources Pay(IResources cost); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Skeleton/IntergalacticTravel/Exceptions/InsufficientResourcesException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.Serialization; 3 | 4 | namespace IntergalacticTravel.Exceptions 5 | { 6 | public class InsufficientResourcesException : Exception 7 | { 8 | public InsufficientResourcesException() 9 | { 10 | } 11 | 12 | public InsufficientResourcesException(string message) : base(message) 13 | { 14 | } 15 | 16 | public InsufficientResourcesException(string message, Exception innerException) : base(message, innerException) 17 | { 18 | } 19 | 20 | protected InsufficientResourcesException(SerializationInfo info, StreamingContext context) : base(info, context) 21 | { 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Skeleton/IntergalacticTravel/Exceptions/InvalidTeleportationLocationException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.Serialization; 3 | 4 | namespace IntergalacticTravel.Exceptions 5 | { 6 | public class InvalidTeleportationLocationException : Exception 7 | { 8 | public InvalidTeleportationLocationException() 9 | { 10 | } 11 | 12 | public InvalidTeleportationLocationException(string message) : base(message) 13 | { 14 | } 15 | 16 | public InvalidTeleportationLocationException(string message, Exception innerException) : base(message, innerException) 17 | { 18 | } 19 | 20 | protected InvalidTeleportationLocationException(SerializationInfo info, StreamingContext context) : base(info, context) 21 | { 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Skeleton/IntergalacticTravel/Exceptions/InvalidUnitCreationCommandException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.Serialization; 3 | 4 | namespace IntergalacticTravel.Exceptions 5 | { 6 | public class InvalidUnitCreationCommandException : Exception 7 | { 8 | public InvalidUnitCreationCommandException() 9 | { 10 | } 11 | 12 | public InvalidUnitCreationCommandException(string message) : base(message) 13 | { 14 | } 15 | 16 | public InvalidUnitCreationCommandException(string message, Exception innerException) : base(message, innerException) 17 | { 18 | } 19 | 20 | protected InvalidUnitCreationCommandException(SerializationInfo info, StreamingContext context) : base(info, context) 21 | { 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Skeleton/IntergalacticTravel/Exceptions/LocationNotFoundException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.Serialization; 3 | 4 | namespace IntergalacticTravel.Exceptions 5 | { 6 | public class LocationNotFoundException : Exception 7 | { 8 | public LocationNotFoundException() 9 | { 10 | } 11 | 12 | public LocationNotFoundException(string message) : base(message) 13 | { 14 | } 15 | 16 | public LocationNotFoundException(string message, Exception innerException) : base(message, innerException) 17 | { 18 | } 19 | 20 | protected LocationNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context) 21 | { 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Skeleton/IntergalacticTravel/Extensions/IEnumerableExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | 4 | namespace IntergalacticTravel.Extensions 5 | { 6 | public static class IEnumerableExtensions 7 | { 8 | public static bool IsNullOrEmpty(this IEnumerable enumeration) 9 | { 10 | return enumeration == null || 11 | enumeration.Count() == 0; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Skeleton/IntergalacticTravel/Extensions/ObjectExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace IntergalacticTravel.Extensions 2 | { 3 | public static class ObjectExtensions 4 | { 5 | public static bool IsNull(this object obj) 6 | { 7 | return obj == null; 8 | } 9 | 10 | public static bool IsNotNull(this object obj) 11 | { 12 | return obj != null; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Skeleton/IntergalacticTravel/Lacaille.cs: -------------------------------------------------------------------------------- 1 | namespace IntergalacticTravel 2 | { 3 | /// 4 | /// Imma dummy class 5 | /// 6 | internal class Lacaille : Unit 7 | { 8 | public Lacaille(int identificationNumber, string nickName) : base(identificationNumber, nickName) 9 | { 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Skeleton/IntergalacticTravel/Luyten.cs: -------------------------------------------------------------------------------- 1 | namespace IntergalacticTravel 2 | { 3 | /// 4 | /// Imma dummy class 5 | /// 6 | internal class Luyten : Unit 7 | { 8 | public Luyten(int identificationNumber, string nickName) : base(identificationNumber, nickName) 9 | { 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Topics/Exams/2016_07/Exam_Skeleton/IntergalacticTravel/Procyon.cs: -------------------------------------------------------------------------------- 1 | namespace IntergalacticTravel 2 | { 3 | /// 4 | /// Imma dummy class 5 | /// 6 | internal class Procyon : Unit 7 | { 8 | public Procyon(int identificationNumber, string nickName) : base(identificationNumber, nickName) 9 | { 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Topics/Exams/2017_01/Exam_AuthorSolution/AcademyPackageManager.Tests/Commands/InstallCommandTests/Execute_Should.cs: -------------------------------------------------------------------------------- 1 | using Moq; 2 | using NUnit.Framework; 3 | using PackageManager.Commands; 4 | using PackageManager.Core.Contracts; 5 | using PackageManager.Models.Contracts; 6 | 7 | namespace AcademyPackageManager.Tests.Commands.InstallCommandTests 8 | { 9 | [TestFixture] 10 | public class Execute_Should 11 | { 12 | [Test] 13 | public void CallPerformOperationFromInstaller_WhenTheCommandIsExecuted() 14 | { 15 | // Arrange 16 | var installerMock = new Mock>(); 17 | var packageMock = new Mock(); 18 | 19 | var command = new InstallCommand(installerMock.Object, packageMock.Object); 20 | 21 | // Act 22 | command.Execute(); 23 | 24 | // Assert 25 | installerMock.Verify(x => x.PerformOperation(packageMock.Object), Times.Once); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Topics/Exams/2017_01/Exam_AuthorSolution/AcademyPackageManager.Tests/Commands/Mocks/InstallCommandMock.cs: -------------------------------------------------------------------------------- 1 | using PackageManager.Commands; 2 | using PackageManager.Core.Contracts; 3 | using PackageManager.Models.Contracts; 4 | 5 | namespace AcademyPackageManager.Tests.Commands.Mocks 6 | { 7 | internal class InstallCommandMock : InstallCommand 8 | { 9 | public InstallCommandMock(IInstaller installer, IPackage package) 10 | : base(installer, package) 11 | { 12 | } 13 | 14 | public IInstaller MyInstaller 15 | { 16 | get 17 | { 18 | return this.Installer; 19 | } 20 | } 21 | 22 | public IPackage MyPackage 23 | { 24 | get 25 | { 26 | return this.Package; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Topics/Exams/2017_01/Exam_AuthorSolution/AcademyPackageManager.Tests/Core/PackageInstallerTests/Mocks/PackageInstallerMock.cs: -------------------------------------------------------------------------------- 1 | using PackageManager.Core; 2 | using PackageManager.Core.Contracts; 3 | using PackageManager.Models.Contracts; 4 | 5 | namespace AcademyPackageManager.Tests.Core.PackageInstallerTests.Mocks 6 | { 7 | internal class PackageInstallerMock : PackageInstaller 8 | { 9 | public PackageInstallerMock(IDownloader downloader, IProject project) 10 | : base(downloader, project) 11 | { 12 | } 13 | 14 | public int Counter { get; private set; } 15 | 16 | public override void PerformOperation(IPackage package) 17 | { 18 | this.Counter++; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Topics/Exams/2017_01/Exam_AuthorSolution/AcademyPackageManager.Tests/CustomExceptions/UpdateMethodCalledException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace AcademyPackageManager.Tests.CustomExceptions 4 | { 5 | public class UpdateMethodCalledException : Exception 6 | { 7 | public UpdateMethodCalledException(string msg) 8 | : base(msg) 9 | { 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Topics/Exams/2017_01/Exam_AuthorSolution/AcademyPackageManager.Tests/Repositories/Mocks/PackageRepositoryMock.cs: -------------------------------------------------------------------------------- 1 | using PackageManager.Repositories; 2 | using System.Collections.Generic; 3 | using PackageManager.Info.Contracts; 4 | using PackageManager.Models.Contracts; 5 | using AcademyPackageManager.Tests.CustomExceptions; 6 | 7 | namespace AcademyPackageManager.Tests.Repositories.Mocks 8 | { 9 | public class PackageRepositoryMock : PackageRepository 10 | { 11 | public PackageRepositoryMock(ILogger logger, ICollection packages = null) 12 | : base(logger, packages) 13 | { 14 | } 15 | 16 | public override bool Update(IPackage package) 17 | { 18 | throw new UpdateMethodCalledException("The update method is called"); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Topics/Exams/2017_01/Exam_AuthorSolution/AcademyPackageManager.Tests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Topics/Exams/2017_01/Exam_AuthorSolution/PackageManager/Commands/Contracts/ICommand.cs: -------------------------------------------------------------------------------- 1 | namespace PackageManager.Commands.Contracts 2 | { 3 | public interface ICommand 4 | { 5 | void Execute(); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Topics/Exams/2017_01/Exam_AuthorSolution/PackageManager/Core/Contracts/IDownloader.cs: -------------------------------------------------------------------------------- 1 | namespace PackageManager.Core.Contracts 2 | { 3 | internal interface IDownloader 4 | { 5 | string Location { get; set; } 6 | 7 | void Download(string url); 8 | 9 | void Remove(string name); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Topics/Exams/2017_01/Exam_AuthorSolution/PackageManager/Core/Contracts/IInstaller.cs: -------------------------------------------------------------------------------- 1 | using PackageManager.Enums; 2 | 3 | namespace PackageManager.Core.Contracts 4 | { 5 | internal interface IInstaller 6 | { 7 | InstallerOperation Operation { get; set; } 8 | 9 | string BasicFolder { get; } 10 | 11 | void PerformOperation(T obj); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Topics/Exams/2017_01/Exam_AuthorSolution/PackageManager/Core/Contracts/IManager.cs: -------------------------------------------------------------------------------- 1 | namespace PackageManager.Core.Contracts 2 | { 3 | internal interface IManager 4 | { 5 | bool Create(string path); 6 | 7 | bool Delete(string path); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Topics/Exams/2017_01/Exam_AuthorSolution/PackageManager/Core/DirectoryManager.cs: -------------------------------------------------------------------------------- 1 | using PackageManager.Core.Contracts; 2 | using System.IO; 3 | 4 | namespace PackageManager.Core 5 | { 6 | public class DirectoryManager : IManager 7 | { 8 | public bool Create(string path) 9 | { 10 | if (!Directory.Exists(path)) 11 | { 12 | Directory.CreateDirectory(path); 13 | return true; 14 | } 15 | 16 | return false; 17 | } 18 | 19 | public bool Delete(string path) 20 | { 21 | if (Directory.Exists(path)) 22 | { 23 | Directory.Delete(path, true); 24 | return true; 25 | } 26 | 27 | return false; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Topics/Exams/2017_01/Exam_AuthorSolution/PackageManager/Enums/InstallerOperation.cs: -------------------------------------------------------------------------------- 1 | namespace PackageManager.Enums 2 | { 3 | public enum InstallerOperation 4 | { 5 | Install = 0, 6 | Uninstall = 1, 7 | Update = 2 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Topics/Exams/2017_01/Exam_AuthorSolution/PackageManager/Enums/VersionType.cs: -------------------------------------------------------------------------------- 1 | namespace PackageManager.Enums 2 | { 3 | public enum VersionType 4 | { 5 | alpha = 0, 6 | beta = 1, 7 | rc = 2, 8 | final = 3 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Topics/Exams/2017_01/Exam_AuthorSolution/PackageManager/Info/ConsoleLogger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | using PackageManager.Info.Contracts; 4 | 5 | namespace PackageManager.Info 6 | { 7 | public class ConsoleLogger : ILogger 8 | { 9 | public void Log(string message) 10 | { 11 | Console.WriteLine(message); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Topics/Exams/2017_01/Exam_AuthorSolution/PackageManager/Info/Contracts/ILogger.cs: -------------------------------------------------------------------------------- 1 | namespace PackageManager.Info.Contracts 2 | { 3 | public interface ILogger 4 | { 5 | void Log(string message); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Topics/Exams/2017_01/Exam_AuthorSolution/PackageManager/Models/Contracts/IPackage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace PackageManager.Models.Contracts 5 | { 6 | public interface IPackage : IComparable 7 | { 8 | string Name { get; } 9 | 10 | string Url { get; } 11 | 12 | IVersion Version { get; set; } 13 | 14 | ICollection Dependencies { get; } 15 | 16 | bool Equals(object obj); 17 | 18 | int GetHashCode(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Topics/Exams/2017_01/Exam_AuthorSolution/PackageManager/Models/Contracts/IProject.cs: -------------------------------------------------------------------------------- 1 | using PackageManager.Repositories.Contracts; 2 | 3 | namespace PackageManager.Models.Contracts 4 | { 5 | public interface IProject 6 | { 7 | string Name { get; } 8 | 9 | string Location { get; } 10 | 11 | IRepository PackageRepository { get; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Topics/Exams/2017_01/Exam_AuthorSolution/PackageManager/Models/Contracts/IVersion.cs: -------------------------------------------------------------------------------- 1 | using PackageManager.Enums; 2 | 3 | namespace PackageManager.Models.Contracts 4 | { 5 | public interface IVersion 6 | { 7 | int Major { get; } 8 | 9 | int Minor { get; } 10 | 11 | int Patch { get; } 12 | 13 | VersionType VersionType { get; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Topics/Exams/2017_01/Exam_AuthorSolution/PackageManager/Repositories/Contracts/IRepository.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace PackageManager.Repositories.Contracts 4 | { 5 | public interface IRepository 6 | { 7 | void Add(T package); 8 | 9 | bool Update(T package); 10 | 11 | IEnumerable GetAll(); 12 | 13 | T Delete(T package); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Topics/Exams/2017_01/Exam_Skeleton/AcademyPackageManager/PackageManager/Commands/Contracts/ICommand.cs: -------------------------------------------------------------------------------- 1 | namespace PackageManager.Commands.Contracts 2 | { 3 | public interface ICommand 4 | { 5 | void Execute(); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Topics/Exams/2017_01/Exam_Skeleton/AcademyPackageManager/PackageManager/Core/Contracts/IDownloader.cs: -------------------------------------------------------------------------------- 1 | namespace PackageManager.Core.Contracts 2 | { 3 | internal interface IDownloader 4 | { 5 | string Location { get; set; } 6 | 7 | void Download(string url); 8 | 9 | void Remove(string name); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Topics/Exams/2017_01/Exam_Skeleton/AcademyPackageManager/PackageManager/Core/Contracts/IInstaller.cs: -------------------------------------------------------------------------------- 1 | using PackageManager.Enums; 2 | 3 | namespace PackageManager.Core.Contracts 4 | { 5 | internal interface IInstaller 6 | { 7 | InstallerOperation Operation { get; set; } 8 | 9 | string BasicFolder { get; } 10 | 11 | void PerformOperation(T obj); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Topics/Exams/2017_01/Exam_Skeleton/AcademyPackageManager/PackageManager/Core/Contracts/IManager.cs: -------------------------------------------------------------------------------- 1 | namespace PackageManager.Core.Contracts 2 | { 3 | internal interface IManager 4 | { 5 | bool Create(string path); 6 | 7 | bool Delete(string path); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Topics/Exams/2017_01/Exam_Skeleton/AcademyPackageManager/PackageManager/Enums/InstallerOperation.cs: -------------------------------------------------------------------------------- 1 | namespace PackageManager.Enums 2 | { 3 | public enum InstallerOperation 4 | { 5 | Install = 0, 6 | Uninstall = 1, 7 | Update = 2 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Topics/Exams/2017_01/Exam_Skeleton/AcademyPackageManager/PackageManager/Enums/VersionType.cs: -------------------------------------------------------------------------------- 1 | namespace PackageManager.Enums 2 | { 3 | public enum VersionType 4 | { 5 | alpha = 0, 6 | beta = 1, 7 | rc = 2, 8 | final = 3 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Topics/Exams/2017_01/Exam_Skeleton/AcademyPackageManager/PackageManager/Info/ConsoleLogger.cs: -------------------------------------------------------------------------------- 1 | using PackageManager.Info.Contracts; 2 | using System; 3 | 4 | namespace PackageManager.Info 5 | { 6 | public class ConsoleLogger : ILogger 7 | { 8 | public void Log(string message) 9 | { 10 | Console.WriteLine(message); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Topics/Exams/2017_01/Exam_Skeleton/AcademyPackageManager/PackageManager/Info/Contracts/ILogger.cs: -------------------------------------------------------------------------------- 1 | namespace PackageManager.Info.Contracts 2 | { 3 | public interface ILogger 4 | { 5 | void Log(string message); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Topics/Exams/2017_01/Exam_Skeleton/AcademyPackageManager/PackageManager/Models/Contracts/IPackage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace PackageManager.Models.Contracts 5 | { 6 | public interface IPackage : IComparable 7 | { 8 | string Name { get; } 9 | 10 | string Url { get; } 11 | 12 | IVersion Version { get; set; } 13 | 14 | ICollection Dependencies { get; } 15 | 16 | bool Equals(object obj); 17 | 18 | int GetHashCode(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Topics/Exams/2017_01/Exam_Skeleton/AcademyPackageManager/PackageManager/Models/Contracts/IProject.cs: -------------------------------------------------------------------------------- 1 | using PackageManager.Repositories.Contracts; 2 | 3 | namespace PackageManager.Models.Contracts 4 | { 5 | public interface IProject 6 | { 7 | string Name { get; } 8 | 9 | string Location { get; } 10 | 11 | IRepository PackageRepository { get; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Topics/Exams/2017_01/Exam_Skeleton/AcademyPackageManager/PackageManager/Models/Contracts/IVersion.cs: -------------------------------------------------------------------------------- 1 | using PackageManager.Enums; 2 | 3 | namespace PackageManager.Models.Contracts 4 | { 5 | public interface IVersion 6 | { 7 | int Major { get; } 8 | 9 | int Minor { get; } 10 | 11 | int Patch { get; } 12 | 13 | VersionType VersionType { get; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Topics/Exams/2017_01/Exam_Skeleton/AcademyPackageManager/PackageManager/Repositories/Contracts/IRepository.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace PackageManager.Repositories.Contracts 4 | { 5 | public interface IRepository 6 | { 7 | void Add(T package); 8 | 9 | bool Update(T package); 10 | 11 | IEnumerable GetAll(); 12 | 13 | T Delete(T package); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Topics/Exams/2017_01/Exam_Skeleton/Bug_Found.txt: -------------------------------------------------------------------------------- 1 | // Where is the bug :) --------------------------------------------------------------------------------