コード例 #1
0
ファイル: RoomFilterTest.cs プロジェクト: rnofenko/Calendar
        public void SetupFixture()
        {
            FakeDi.Register();

            _config = Config.Instance as FakeConfig;

            var repoUnit = new RepoUnit();
            Ioc.RegisterInstance<RepoUnit>(repoUnit);

            _rooms.Values.ToList().ForEach(repoUnit.Room.Save);

            _roomService = new RoomService(repoUnit);
            Ioc.RegisterInstance<RoomService>(_roomService);
        }
コード例 #2
0
ファイル: RoomFrameTest.cs プロジェクト: rnofenko/Calendar
        public void Setup()
        {
            FakeDi.Register();

            _rooms = new List<Room>
            {
                new Room {Name = "First room", Color = 1, NumberOfPlaces = 78},
                new Room {Name = "Second room", Color = 5, NumberOfPlaces = 12},
                new Room {Name = "Third room", Color = 2, NumberOfPlaces = 6},
            };

            var mockRepository = new Mock<IRoomRepository>();
            mockRepository.Setup(m => m.Load()).Returns(_rooms.AsQueryable());

            Ioc.RegisterInstance<IRoomRepository>(mockRepository.Object);
            _roomService = Ioc.Resolve<RoomService>();
        }
コード例 #3
0
ファイル: RoomController.cs プロジェクト: rnofenko/Calendar
 public RoomController(RoomService service)
 {
     _service = service;
 }