Exemple #1
0
 void JsonDataをEntityに変換することができる()
 {
     var dataStoreMoq             = new Mock <IConnpassDataStore>();
     var connpassDataRepository   = new ConnpassReadOnlyWebsiteWebsiteDataRepository(dataStoreMoq.Object);
     var targetData               = new ConnpassEvent();
     ConnpassEventDataEntity item = connpassDataRepository.convert(targetData);
 }
Exemple #2
0
        void ConnpassDataRepositoryはIConnpassDataRepositoryを実装する()
        {
            var dataStoreMoq           = new Mock <IConnpassDataStore>();
            var connpassDataRepository = new ConnpassReadOnlyWebsiteWebsiteDataRepository(dataStoreMoq.Object);
            var actual = connpassDataRepository as IConnpassReadOnlyWebsiteDataRepository;

            Assert.NotNull(actual);
        }
Exemple #3
0
        void データを更新するとデータストアからデータを取得してくる()
        {
            var dataStoreMoq      = new Mock <IConnpassDataStore>();
            var dummyConnpassData = new ConnpassMeetupJson();

            dataStoreMoq.Setup(obj => obj.LoadConnpassDataAsync(100, 0)).ReturnsAsync(dummyConnpassData);
            var connpassDataRepository = new ConnpassReadOnlyWebsiteWebsiteDataRepository(dataStoreMoq.Object);

            connpassDataRepository.LoadConnpassData();
            dataStoreMoq.Verify(obj => obj.LoadConnpassDataAsync(100, 0), Times.Once);
        }
Exemple #4
0
        void イベントURLが存在しない場合は空文字が入っている(string dummyEventUrl)
        {
            var dataStoreMoq           = new Mock <IConnpassDataStore>();
            var connpassDataRepository = new ConnpassReadOnlyWebsiteWebsiteDataRepository(dataStoreMoq.Object);
            var targetData             = new ConnpassEvent
            {
                title = dummyEventUrl
            };
            ConnpassEventDataEntity item = connpassDataRepository.convert(targetData);

            Assert.Equal("", item.title);
        }
Exemple #5
0
        void  換されたEntityにはURLが保存されている()
        {
            var dataStoreMoq           = new Mock <IConnpassDataStore>();
            var connpassDataRepository = new ConnpassReadOnlyWebsiteWebsiteDataRepository(dataStoreMoq.Object);
            var dummyEventUrl          = "www.yahoo.co.jp";
            var targetData             = new ConnpassEvent
            {
                event_url = dummyEventUrl
            };
            ConnpassEventDataEntity item = connpassDataRepository.convert(targetData);

            Assert.Equal(dummyEventUrl, item.event_url);
        }
Exemple #6
0
        void  換されたDomainEntityにはタイトルが保存されている()
        {
            var dataStoreMoq           = new Mock <IConnpassDataStore>();
            var connpassDataRepository = new ConnpassReadOnlyWebsiteWebsiteDataRepository(dataStoreMoq.Object);
            var dummyTitle             = "";
            var targetData             = new ConnpassEvent
            {
                title = dummyTitle
            };
            ConnpassEventDataEntity item = connpassDataRepository.convert(targetData);

            Assert.Equal(dummyTitle, item.title);
        }
Exemple #7
0
        void イベントIDがEntityに含まれている()
        {
            var dataStoreMoq           = new Mock <IConnpassDataStore>();
            var connpassDataRepository = new ConnpassReadOnlyWebsiteWebsiteDataRepository(dataStoreMoq.Object);
            var dummyEventId           = 123;
            var targetData             = new ConnpassEvent
            {
                event_id = dummyEventId
            };
            var item = connpassDataRepository.convert(targetData);

            Assert.Equal(dummyEventId, item.Id);
        }
Exemple #8
0
        void イベント詳細に不正な値が含まれているときはから文字が返ってくる(string dummmyEventDescription)
        {
            var dataStoreMoq           = new Mock <IConnpassDataStore>();
            var connpassDataRepository = new ConnpassReadOnlyWebsiteWebsiteDataRepository(dataStoreMoq.Object);

            var targetData = new ConnpassEvent
            {
                description = dummmyEventDescription
            };
            var item = connpassDataRepository.convert(targetData);

            Assert.Equal("", item.description);
        }
Exemple #9
0
        void イベント詳細がEntityに含まれる()
        {
            var dataStoreMoq           = new Mock <IConnpassDataStore>();
            var connpassDataRepository = new ConnpassReadOnlyWebsiteWebsiteDataRepository(dataStoreMoq.Object);
            var dummmyEventDescription = "Hello";
            var targetData             = new ConnpassEvent
            {
                description = dummmyEventDescription
            };
            var item = connpassDataRepository.convert(targetData);

            Assert.Equal(dummmyEventDescription, item.description);
        }
Exemple #10
0
        void イベントの開催される場所がEntityに含まれる()
        {
            var dataStoreMoq           = new Mock <IConnpassDataStore>();
            var connpassDataRepository = new ConnpassReadOnlyWebsiteWebsiteDataRepository(dataStoreMoq.Object);

            var targetData = new ConnpassEvent
            {
                lon = "123.2",
                lat = "456.4"
            };
            var item = connpassDataRepository.convert(targetData);

            Assert.Equal(targetData.lon, item.Lon.ToString());
            Assert.Equal(targetData.lat, item.Lat.ToString());
        }
Exemple #11
0
 void ConnpassDataRepositoryが存在する()
 {
     var dataStoreMoq           = new Mock <IConnpassDataStore>();
     var connpassDataRepository = new ConnpassReadOnlyWebsiteWebsiteDataRepository(dataStoreMoq.Object);
 }