コード例 #1
0
 public void SetUp()
 {
     _admin = Substitute.For<IAdmin>();
     _autocomplete = Substitute.For<IAutocomplete>();
     _msgBox = Substitute.For<ICreateMsgBox>();
     _uut = new AdminDeleteStoreModel(_admin, _autocomplete, _msgBox);
     _store = new Store() {StoreId = 12, StoreName = "Lidl"};
 }
        public void SetUp()
        {
            _context = new DataContext();
            _unitOfWork = new UnitOfWork(_context);
            _autocomplete = new Autocomplete(_unitOfWork);
            _msgBox = Substitute.For<ICreateMsgBox>();
            _admin = new Admin(_unitOfWork);
            _adminDeleteStoreModel = new AdminDeleteStoreModel(_admin, _autocomplete, _msgBox);
            _context.Database.Connection.ConnectionString = "Server=.\\SQLEXPRESS;Database=Pristjek220Data.DataContext; Trusted_Connection=True;";
            _context.Database.ExecuteSqlCommand("dbo.TestCleanTable");
            _secureStringTest.AppendChar('A');
            _secureStringTest.AppendChar('B');
            _secureStringTest.AppendChar('C');

            _admin.CreateLogin("Teststore", _secureStringTest, "Teststore");
            _msgBox.DeleteStoreMgsConfirmation("Teststore").Returns(DialogResult.Yes);
        }