Ejemplo n.º 1
0
        public void Initialize()
        {
            fakeAggregatedStories = new AggregatedStory[]
            {
                new AggregatedStory { Story = new Story { Message = "First story", PostedOn = new DateTime(2000, 1, 1, 15, 1, 0) }},
                new AggregatedStory { Story = new Story { Message = "Second story", PostedOn = new DateTime(2000, 1, 1, 15, 5, 0) }}
            };

            //Creates a fake IAggregatorService with a liked observer in order to
            //assert that the SUT relies on it
            aggregatorServiceObserver = new StubObserver();
            aggregatorService = new Contracts.Interfaces.Fakes.StubIAggregatorService
            {
                InstanceObserver = aggregatorServiceObserver,
                GetAggregatedStoriesString = userName => fakeAggregatedStories
            };

            aggregatedStoryFormatterObserver = new StubObserver();
            aggregatedStoryFormatter = new Contracts.Interfaces.Fakes.StubIEntityFormatter<AggregatedStory>
            {
                InstanceObserver = aggregatedStoryFormatterObserver,
                FormatT0 = aggregatedStory => aggregatedStory.Story.Message
            };

            sut = new WallCommand(aggregatorService, aggregatedStoryFormatter);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// </summary>
 /// <param name="aggregatorService">Service class to use to perform the command</param>
 /// <param name="storyFormatter">Object that this class uses to text-render the aggregated story items</param>
 public WallCommand(IAggregatorService aggregatorService, IEntityFormatter<AggregatedStory> storyFormatter)
 {
     this.aggregatorService = aggregatorService;
     this.storyFormatter = storyFormatter;
 }