fix test
This commit is contained in:
parent
7f7cbd26af
commit
3a1b867c29
@ -305,9 +305,8 @@ internal class InstallationBusinessLogicContractTest
|
||||
[Test]
|
||||
public void InsertInstallation_CorrectRecord_Test()
|
||||
{
|
||||
//Arrange
|
||||
var flag = false;
|
||||
var record = new InstallationDataModel(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), DateTime.UtcNow, 10, 0, false,
|
||||
var record = new InstallationDataModel(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), DateTime.UtcNow, 10, 10, false,
|
||||
[new InstallationComponentDataModel(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), 5)]);
|
||||
_installationStorageContract.Setup(x => x.AddElement(It.IsAny<InstallationDataModel>()))
|
||||
.Callback((InstallationDataModel x) =>
|
||||
@ -333,7 +332,7 @@ internal class InstallationBusinessLogicContractTest
|
||||
_installationStorageContract.Setup(x => x.AddElement(It.IsAny<InstallationDataModel>())).Throws(new ElementExistsException("Data", "Data"));
|
||||
//Act&Assert
|
||||
Assert.That(() => _installationBusinessLogicContract.InsertInstallation(new(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(),
|
||||
DateTime.UtcNow, 10, 0, false, [new InstallationComponentDataModel(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), 5)])), Throws.TypeOf<ElementExistsException>());
|
||||
DateTime.UtcNow, 10, 10, false, [new InstallationComponentDataModel(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), 5)])), Throws.TypeOf<ElementExistsException>());
|
||||
_installationStorageContract.Verify(x => x.AddElement(It.IsAny<InstallationDataModel>()), Times.Once);
|
||||
}
|
||||
|
||||
@ -360,7 +359,7 @@ internal class InstallationBusinessLogicContractTest
|
||||
_installationStorageContract.Setup(x => x.AddElement(It.IsAny<InstallationDataModel>())).Throws(new StorageException(new InvalidOperationException()));
|
||||
//Act&Assert
|
||||
Assert.That(() => _installationBusinessLogicContract.InsertInstallation(new(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(),
|
||||
DateTime.UtcNow, 10, 0, false, [new InstallationComponentDataModel(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), 5)])), Throws.TypeOf<StorageException>());
|
||||
DateTime.UtcNow, 10, 10, false, [new InstallationComponentDataModel(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), 5)])), Throws.TypeOf<StorageException>());
|
||||
_installationStorageContract.Verify(x => x.AddElement(It.IsAny<InstallationDataModel>()), Times.Once);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user