Beispiel #1
0
        public void AddSameActivityShouldFail()
        {
            // Arrange
            var activity = new TimelineActivityMother().Build();
            var timeline = new TimelineMother().Build();
            var originalCount = timeline.GetActivities().Count;
            const int expectedCount = 1;

            // Act
            try
            {
                timeline.AddActivity(activity);
                timeline.AddActivity(activity);
            }catch (Exception)
            {
                var actualCount = timeline.GetActivities().Count;

                // Assert
                Assert.AreEqual(expectedCount, actualCount);
                throw;
            }
        }
Beispiel #2
0
        public void GetActivityTest()
        {
            // Arrange
            var activity = new TimelineActivityMother().Build();
            var timeline = new TimelineMother().Build();
            timeline.AddActivity(activity);

            // Act
            var actual = timeline.GetActivity(activity.Id);

            // Assert
            Assert.AreSame(activity, actual);
        }
Beispiel #3
0
        public void AddActivityTest()
        {
            // Arrange
            var activity = new TimelineActivityMother().Build();
            var timeline = new TimelineMother().Build();
            var originalCount = timeline.GetActivities().Count;
            const int expectedCount = 1;

            // Act
            timeline.AddActivity(activity);
            var actual = timeline.GetActivity(activity.Id);
            var actualCount = timeline.GetActivities().Count;

            // Assert
            Assert.IsNotNull(actual);
            Assert.AreEqual(expectedCount, actualCount);
            Assert.AreNotEqual(originalCount, actualCount);
        }