변수에서 오류가 납니다 ㅠㅠ
190
작성한 질문수 10
** 매입자의 이름이 sejong이 아닙니다.
expected - actual
-sejng
+sejong
at testTestRealEstate.js:27:16
at process.tickCallback (internal/process/nexttick.js:68:7)
이라고 나오고요.. 강의 따라서 *
var RealEstate = artifacts.require("./RealEstate.sol");
contract('RealEstate', function(accounts){
var realEstateInstance;
it("컨트렉의 소유자 초기화 테스팅", function(){ return RealEstate.deployed().then(function(instance){
realEstateInstance = instance ;
return realEstateInstance.owner.call();
}).then(function(owner){
assert.equal(owner.toUpperCase(), accounts[0].toUpperCase(), "owner가 가나슈 첫번째 계정과 동일하지 않습니다.");
});
});
it("가나슈 두 번째 계정으로 매물 아이디 0번 매입 후 이벤트 생성 및 매입자 정보와 buyers 배열 테스팅", function() {
return RealEstate.deployed().then(function(instance){
realEstateInstance = instance;
return realEstateInstance.buyRealEstate(0, "sejong", 13, { from: accounts[1], value: web3.toWei(1.50,"ether")});
}).then(function(receipt){
assert.equal(receipt.logs.length, 1, "이벤트 하나가 생성되지 않았습니다.");
assert.equal(receipt.logs[0].event, "LogBuyRealEstate", "이벤트가 LogBuyRealEstate 아닙니다");
assert.equal(receipt.logs[0].args._buyer, accounts[1], "매입자가 가나슈 두번째 계정이 아닙니다.");
assert.equal(receipt.logs[0].args._id, 0, "매물 아이디가 0 이 아닙니다");
return realEstateInstance.getBuyerInfo(0);
}).then(function(buyerInfo){
assert.equal(buyerInfo[0].toUpperCase(), accounts[1].toUpperCase(),"매입자의 계정이 두번째 계정과 일치하지 않습니다");
assert.equal(web3.toAscii(buyerInfo[1]).replace(/o/g, ''), "sejong", "매입자의 이름이 sejong이 아닙니다.");
assert.equal(buyerInfo[2], 13, "매입자의 나이가 13이 아닙니다.");
return realEstateInstance.getAllBuyers();
}).then(function(buyers) {
assert.equal(buyers[0].toUpperCase(), accounts[1].toUpperCase(), "Buyers 배열 첫번째 인덱스의 계정이 가나슈 두번쨰 계정과 일치하지 않습니다");
})
})
});
답변 1
0
안녕하세요. 이 강의에 추가된 프로젝트 파일 다운받아보시고 실행해 보시겠어요? 실행이 성공적이라면은 한번 비교해보시면 될거같아요. 그래도 안돼면 코멘트 남겨주시구요.
[긴급] 전체 소스코드 파일 있었던거 같은데 어디서 받나요?
0
239
2
블록체인 강의
0
174
2
강의내용 질문입니다 메타마스크
0
277
1
truffle develop 명령 오류
0
413
0
메타마스크 창이 안뜨네요 ㅜ
0
463
2
전제 소스 코드
1
275
0
miner.stop() 오류
0
297
0
매입 실행 시 메타마스크와 연동이 안되고 창이 안뜨고 있네요
0
654
2
코드가 다운받아지지 않습니다.
0
255
1
git에 올리신 자료 관련
0
329
2
geth rpc 에러입니다.
0
547
2
수업 자료
1
283
1
truffle 버전
2
248
0
Geth의 버전이 업데이트 되면서 실행되지 않았습니다. 의 해결법 (nodestart)
1
386
1
TypeError: Contracts.compile is not a function / powershell에 migrate 시 오류발생
0
367
1
./nodestrart.cmd
0
273
1
truffle migrate 실행 시 오류
0
254
0
nodestart.cmd 파일 실행시 오류
0
758
1
필드 초기화 질문
0
217
0
truffle 이렇다는데,, 업데이트 하게되면 강의를 들을수 있나요..?
0
212
0
puppeth 명령어 실행이 안됩니다.
0
434
1
truffle init 시 에러
0
206
0
nodestart 질문
0
484
1
메타마스크 질문
0
173
0





