コード例 #1
0
        public async Task UpdateScope_ScopeExists_ScopeNameIsAccurate(int id, string expectedUpdatedName, string expectedDescriptionName, bool expectedDefaultValue)
        {
            // Arrange
            IScopeRepository scopeRepository = new ScopeRepository(new SQLServerGateway(), new ConnectionStringData());
            ScopeModel       scopeModel      = new ScopeModel();

            scopeModel.Id          = id;
            scopeModel.Type        = expectedUpdatedName;
            scopeModel.Description = expectedDescriptionName;
            scopeModel.IsDefault   = expectedDefaultValue;

            // Act
            await scopeRepository.UpdateScope(scopeModel);

            var actual = await scopeRepository.GetScopeById(id);

            var actualName            = actual.Type;
            var actualDescriptionName = actual.Description;
            var actualDefaultValue    = actual.IsDefault;


            // Assert
            Assert.IsTrue(actualName == expectedUpdatedName &&
                          actualDescriptionName == expectedDescriptionName &&
                          actualDefaultValue == expectedDefaultValue);
        }