public void IfTwoClassesWithOneClassNotASourceAreNotEqual()
 {
     var source1 = new Source();
     var source2 = new Object();
     source1.Name = "test";
     Assert.IsFalse(source1.Equals(source2));
 }
 public void IfToStringGivesCorrectString()
 {
     var source1 = new Source();
     source1.Name = "testName";
     source1.Url = "testUrl";
     Assert.AreEqual("testName (testUrl)", source1.ToString());
 }
示例#3
0
 public void IfSourcesAreNotEqualWhenNamesAreNotTheSame()
 {
     var source1 = new Source();
     var source2 = new Source();
     source1.Name = "test";
     source2.Name = "test2";
     Assert.IsFalse(source1.Equals(source2));
 }
示例#4
0
 public void IfSourcesAreEqualWhenNameIsEqual()
 {
     var source1 = new Source();
     var source2 = new Source();
     source1.Name = "test";
     source2.Name = "test";
     Assert.IsTrue(source1.Equals(source2));
 }
        public void IfSetCurrentSourceSetsTheCurrentsource()
        {
            var newService = new Source { Name = "Third Service", Url = "http://third.entry.com"};
            var sourceService = new SourceService(GetMockFileStorageWithSources());

            sourceService.SetCurrentSource(newService);

            Assert.AreEqual(newService, sourceService.Source);
        }
 private void OnCurrentSourceChanged(Source currentsource)
 {
     var handler = CurrentSourceChanged;
     if (handler != null) handler(currentsource);
 }
 public void SetCurrentSource(Source source)
 {
     _currentsource = source;
     OnCurrentSourceChanged(_currentsource);
 }
 public void AddSource(Source source)
 {
     _sources.Add(source);
     SaveSources();
 }
 private void OnCurrentSourceChanged(Source currentsource)
 {
     this.Log().Debug("Current source changed: {0}", currentsource);
     var handler = CurrentSourceChanged;
     if (handler != null) handler(currentsource);
 }
 public void SetCurrentSource(Source source)
 {
     this.Log().Debug("Current source: {0}", source);
     _currentsource = source;
     OnCurrentSourceChanged(_currentsource);
 }
 public void AddSource(Source source)
 {
     this.Log().Debug("Add source: {0}", source);
     _sources.Add(source);
     SaveSources();
 }
示例#12
0
 public bool Equals(Source other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return Equals(other.Name, Name);
 }
 public void GivesHashCodeOfName()
 {
     var source1 = new Source();
     source1.Name = "test2";
     Assert.AreEqual("test2".GetHashCode(), source1.GetHashCode());
 }
 private void _sourceService_CurrentSourceChanged(Source source)
 {
     InvalidateCache();
     ListOfAvailablePackages();
 }
示例#15
0
 private void _sourceService_CurrentSourceChanged(Source source)
 {
     txtSource.Text = source.ToString();
     chkHasODataFeed.Checked = source.HasODataFeed;
 }