コード例 #1
0
ファイル: ProjectTests.cs プロジェクト: hmeydac/SituationRoom
        public void AddAssetToProjectTest()
        {
            // Arrange
            var project = new ProjectMother().Build();
            var asset = new AssetMother().Build();
            var originalCount = project.GetAssets().Count();
            var expectedId = asset.Id;
            var expectedCount = 1;

            // Act
            project.AddAsset(asset);
            var actualAsset = project.GetAsset(asset.Id);
            var actualId = actualAsset.Id;
            var actualCount = project.GetAssets().Count();

            // Assert
            Assert.AreEqual(expectedId, actualId);
            Assert.AreEqual(expectedCount, actualCount);
            Assert.AreNotEqual(originalCount, actualCount);
        }
コード例 #2
0
ファイル: ProjectTests.cs プロジェクト: hmeydac/SituationRoom
        public void RemoveAssetFromProjectTest()
        {
            // Arrange
            var project = new ProjectMother().Build();
            var asset = new AssetMother().Build();
            project.AddAsset(asset);
            var originalCount = project.GetAssets().Count();
            var expected = 0;

            // Act
            project.RemoveAsset(asset.Id);
            var actual = project.GetAssets().Count();

            // Assert
            Assert.AreEqual(expected, actual);
            Assert.AreNotEqual(originalCount, actual);
        }