Пример #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);
 }
Пример #2
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);
        }
Пример #3
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);
        }
Пример #4
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);
        }
Пример #5
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);
        }
Пример #6
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);
        }
Пример #7
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);
        }
Пример #8
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());
        }